from CPU to GPU accelerated

General discussion and chat (archived)
stravinsky

from CPU to GPU accelerated

Unread post by stravinsky » 2012-07-03, 17:50

http://www.removablefeast.com:8000/google-bouncing-balls/

in this demo, for density = "CPU destroying" , the performance is very slow, because the CPU is being used to do paralled processing stuff.
my question is : without changing the code of the benchmark , is it possile to run this demo using the GPU acceleration ?


since this demo is using HTML5, can we make use of the GPU?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35635
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: from CPU to GPU accelerated

Unread post by Moonchild » 2012-07-03, 17:57

Short answer: no.

Long answer: the browser content does not have direct access to graphics card functions like CUDA or Stream. That would be a Bad ThingTM
Since the calculations are not related to drawing (generic functions) you'd have to offload this task using GPU-specific code of the page-specific algorithm to the video card which you cannot do.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

stravinsky

Re: from CPU to GPU accelerated

Unread post by stravinsky » 2012-07-03, 18:04

since demos like "ie9 fish demo" and other html5 demos do use the GPU for better performance. or playing angry birds in the browser with HWA turned off makes it bad performing (running on the CPU, instead of the GPU ) i thought this could be done on this demo too.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35635
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: from CPU to GPU accelerated

Unread post by Moonchild » 2012-07-03, 23:16

It all depends on the way the demo was programmed. Both the "fish" demo and the angry birds game have fairly few calculations, most of it is standard drawing of objects which can be accelerated by using the directx layers. The demo you pointed at is speed limited by the actual calculations done for each dot, not by the drawing of the dots.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

stravinsky

Re: from CPU to GPU accelerated

Unread post by stravinsky » 2012-07-04, 05:20

GPU's do drawing+calculation in games . but that would have to be explicitly programmed by the programmer.
i thought by making some small changes in the FF code, the intensive parallel cpu calls could be intercepted and sent to the GPU.

you can close this thread now.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35635
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: from CPU to GPU accelerated

Unread post by Moonchild » 2012-07-04, 09:47

stravinsky wrote:GPU's do drawing+calculation in games.
Games have direct access to programming the GPU. That's not something you want browser content to be able to do. So it means this is limited to what the actual browser implements as far as acceleration goes (standard, generic functions).
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Locked