Forums - Renderscript not run on GPU

6 posts / 0 new
Last post
Renderscript not run on GPU
PKUEcho
Join Date: 7 Jan 16
Posts: 3
Posted: Thu, 2016-01-07 03:56

Not sure if I've posted it in the right place. I'm stuck here for a long time....

The issue is, I tried many Renderscript apps with different kinds of APIs, but none of them runs on GPU(Adreno 330) on my Nexus 5. Here's my environment:

Device: Nexus 5, Adreno 330

Android: AOSP 4.4.2

 

What I want to do?

I want to develop a GPU benchmark in RenderScript which runs in background.

 

How I find that they not running in GPU?

I hooked the kgsl code in kernel. Actually I found there's a parameter in adreno_context(kernel/drivers/gpu/msm/adreno_drawctxt.c) called type, which specifies the context type as GL, CL or RS. What I see from the log is only OpenGL contexts, no CL or RS even when I run my Renderscript applications.

 

What kind of RS code I've tried?

Many APIs like ScriptIntrinsic for graphics processing, pow function for mathmatic processing, etc. Actually I noticed many people mentioned their codes run on GPU (like http://stackoverflow.com/questions/20487011/renderscript-pow-powr-and-po...), but not on my phone. I'm really stuck here so I made a registration in this forum and hoped somebody can help me about this. 

  • Up0
  • Down0
PKUEcho
Join Date: 7 Jan 16
Posts: 3
Posted: Wed, 2016-01-13 19:20

Anyone can help me? :(

  • Up0
  • Down0
Rex
Join Date: 8 Aug 15
Posts: 45
Posted: Thu, 2016-01-14 19:39

Renderscript doesn't take advantage of the GPU except on Nexus10 (not sure).

Google decided to drop any OpenCL support in favor of Renderscript long ago but Google has failed to actually make Renderscript a viable GPU language. Renderscript also seems to be poorly designed to take advantage of GPUs, i.e. no explicit barrier support and no support for GPU HW engines (rasterizers, scatter/gather, etc...)

For high-performance mobile compute you only really have iOS with Metal. Android is supposed to support Vulkan on some indeterminate future date. Google's mobile compute API is a mess... Sorry for the bad news.

  • Up0
  • Down0
cmaster11
Join Date: 1 Dec 15
Posts: 5
Posted: Mon, 2016-07-04 17:18

RenderScript is now becoming a mature framework.

A new book, which talks about RenderScript, has just been published: RenderScript: parallel computing on Android, the easy way 

Try it out :) There is a wide support for different devices. Vulkan is a good one, but it is not going to spread soon (API >= 23), and only high-end devices for now. RenderScript still rules.

  • Up0
  • Down0
Rex
Join Date: 8 Aug 15
Posts: 45
Posted: Tue, 2016-07-12 10:32

Thanks for the link to the new book.

You stated Renderscript is "now becoming a mature framework". Can you be more clear what you mean here? Are there some new features?

From our work on mobile compute, Renderscript is probably the least mature and least robust in terms of features exported by GPUs. It is easy to program and use, but it really only solves a narrow scope of problems. Also, the biggest short-coming is the lack of actual graphics related primitive support for rasterization despite being called "Render" script.

Renderscript, like many things at Google, seems like a graduate student thesis trying to be a product/solution... When you talk to the people at Google, there isn't anyone really in charge so there's lots of hand-waving and excuses for why Renderscript actually stinks at rendering...

  • Up0
  • Down0
cmaster11
Join Date: 1 Dec 15
Posts: 5
Posted: Tue, 2016-07-12 12:20

Hi, thank you for the observations!

By "mature" I mean its parallel computing side, not the graphics one (it has been even deprecated, starting from Android 23!). I've used it for really a lot of time, on the parallel computing side, and saw extremely good performance (of course, on good devices, it all depends on the provided drivers). 

If you don't need the graphics side, you can really easily, for example, port other parallel computing libraries, e.g. built on CUDA, to RenderScript kernels. Mature means also that there is a broad driver support and performance is +1 on Maali, Adreno and PowerVR chipsets.

Opinion: I don't know the real reason why the rendering/graphics side has been deprecated, but probably because Vulkan was kicking in and, probably, Google wanted to just say "hey, for graphics use this one!".

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.