View Full Version : Youtube H.264 flash decoder using 25-30% GPU for decoding HD videos, since when ?
St Devious
11th September 2009, 21:12
Noticed while I was playing a HD video on youtube in full screen, that my ATI Radeon HD 4870 was being used 25-30%.
Since when did the flash decoder start using so much of GPU ?
LoRd_MuldeR
11th September 2009, 21:18
1. How can you monitor the usage of your GPU?
2. What makes you believe that the GPU is actually uses for decoding and not only doing the scaling?
TheImperial2004
11th September 2009, 21:33
What makes you believe that the GPU is actually uses for decoding and not only doing the scaling?
Isn't the scaling supposed to be "while" decoding ? Isn't a decoder supposed to do the decoding + scaling ?
Which comes first "in processing" , decoding or scaling ?
Atak_Snajpera
11th September 2009, 21:44
1. How can you monitor the usage of your GPU?
You can monitor GPU usage in DX/OpenGL using Ati Tray Tool
2. What makes you believe that the GPU is actually uses for decoding and not only doing the scaling?
25% for simple scaling?
St Devious
11th September 2009, 21:49
1. How can you monitor the usage of your GPU?
2. What makes you believe that the GPU is actually uses for decoding and not only doing the scaling?
1. Using Rivatuner's Hardware monitoring module.
Note: GPU Usage view is only available on ATI Radeon cards. I have talked to Nvidia about adding such a feature in their drivers, but nothing is planned. Even if they are working on it, they are not going to tell beforehand.
2. I have a 1920x1200 monitor and a 1280x1024 monitor.
I can understand that the GPU might be used for scaling when i played the video in full screen on the 1920x1200 monitor as the original video is 1280x720 Youtube HD.
But when i played the video in full screen on the 1280x1024 the video played at native resolution, which I believe does not involve any scaling.
The GPU usage was same in both the cases.
Using Windows 7. Absolutely no codecs installed. Flash Player installed is downloaded from Filehippo.com version number 10.0.32.18. http://www.filehippo.com/download_flashplayer_firefox/
LoRd_MuldeR
11th September 2009, 21:57
Isn't the scaling supposed to be "while" decoding ? Isn't a decoder supposed to do the decoding + scaling ?
No, it doesn't. The decoder is supposed to decode the video and pass it to the renderer. The renderer will scale it, if needed.
If we use something like DXVA, so decoding and scaling both happens "in hardware", it's kind of combined indeed, yes...
25% for simple scaling?
Not sure. But doesn't sound too unrealistic to me. The higher the resolution of the video and the higher the screen size (1920x1200 in his case!), the more work for scaling.
Also it highly depends on the scaling method used by the renderer. Just think about something like NNEDI ;)
Keiyakusha
11th September 2009, 22:06
Well there is no Youtube flash h264 decoder, there is Adobe flash h264 decoder. And it's known to be GPU accelerated, however have no idea what it accelerates because decoder still slow. Also there can be scaling and/or smoothing which has huge performance impact. But that's what I know in general, I don't watch youtube really often...
thewebchat
11th September 2009, 22:10
The Adobe Flash Player does all AVC decoding in (crappy) software. It is then converted to RGB32 and then scaled and composited in "hardware" (or software, it's like the roulette!).
Dark Shikari
11th September 2009, 22:22
Well there is no Youtube flash h264 decoder, there is Adobe flash h264 decoder. And it's known to be GPU acceleratedNo it isn't, it's the Mainconcept software decoder.
Furthermore, there is no such thing as a GPU accelerated decoder; the acceleration is done by a separate ASIC on the card, not the main GPU, because the GPU is probably too slow to decode Level 4.1 in realtime.
St Devious
11th September 2009, 22:40
No it isn't, it's the Mainconcept software decoder.
Furthermore, there is no such thing as a GPU accelerated decoder; the acceleration is done by a separate ASIC on the card, not the main GPU, because the GPU is probably too slow to decode Level 4.1 in realtime.
That's really surprising to hear, especially considering all the Teraflops of performance used up in rendering 3D games.
Keiyakusha
11th September 2009, 22:46
Dark Shikari
You right but by "flash decoder" I meant not the only part witch decodes the stream, but entire software layer involved in displaying youtube videos
LoRd_MuldeR
11th September 2009, 23:10
That's really surprising to hear, especially considering all the Teraflops of performance used up in rendering 3D games.
You need to understand that it's really hard to exploit the enormous theoretical processing power of modern GPU's for an application other than 3D rendering!
Anything that isn't embarrassingly parallel (and we talk about thousands of threads here!) won't run efficiently on a GPU.
Also memory latency is a huge problem on the GPU. While the GPU does a float multiply in 4 cycles, a simple (global) memory access takes ~600 cycles. And that is for the device memory ;)
Transferring data from host memory to device memory (or the other way around) is even much slower than that and can only be invoked from the host side...
Dark Shikari
11th September 2009, 23:11
That's really surprising to hear, especially considering all the Teraflops of performance used up in rendering 3D games.Entropy decoding is inherently non-parallelizable. At best, you can decode multiple frames simultaneously.
And even then, every thread warp on the GPU shares a program counter--and since every CABAC decoding thread will branch differently, each thread warp can only handle one frame. Since a thread warp is 32 threads, that means 31 out of every 32 threads will sit doing nothing. The rest of decoding is nowhere near costly enough to use up more than a couple threads, so most of the GPU would sit doing nothing.
Since GPU processors are not optimized for branchy "normal" applications, they will likely perform much worse at CABAC per clock than, say, a Core 2.
St Devious
11th September 2009, 23:20
You need to understand that it's really hard to exploit the enormous theoretical processing power of modern GPU's for an application other than 3D rendering!
Anything that isn't embarrassingly parallel (and we talk about thousands of threads here!) won't run efficiently on a GPU.
Also memory latency is a huge problem on the GPU. While the GPU does a float multiply in 4 cycles, a simple (global) memory access takes ~600 cycles. And that is for the device memory ;)
Transferring data from host memory to device memory (or the other way around) is even much slower than that and can only be invoked from the host side...
Entropy decoding is inherently non-parallelizable. At best, you can decode multiple frames simultaneously.
And even then, every thread warp on the GPU shares a program counter--and since every CABAC decoding thread will branch differently, each thread warp can only handle one frame. Since a thread warp is 32 threads, that means 31 out of every 32 threads will sit doing nothing. The rest of decoding is nowhere near costly enough to use up more than a couple threads, so most of the GPU would sit doing nothing.
Since GPU processors are not optimized for branchy "normal" applications, they will likely perform much worse at CABAC per clock than, say, a Core 2.
Thank You for the wonderful explanation.
So, in relation to the OP, why is 25% GPU usage being shown ?
foxyshadis
12th September 2009, 08:58
I decompiled the youtube player and there's nothing obviously pointing to the high usage. It's possible that the gpu acceleration of flash player is just that unoptimized or lousy. Look at MPC: Just because it's the same size doesn't mean it doesn't still perform the shader resizing, because no one remembered to check for that. Flash itself, not the youtube player specifically, could also be doing some noise reduction in the gpu when high quality mode is on.
ajp_anton
12th September 2009, 13:52
My HD4850 is used ~0-2% when watching HD videos on Youtube.
Reimar
12th September 2009, 14:13
You can monitor GPU usage in DX/OpenGL using Ati Tray Tool
And what does that thing measure? And what kind of graphics card is it?
For on-board cards using main memory for framebuffer reaching 25% of the memory bandwidth is not hard I would guess.
E.g. it would be possible that the software decoder already uses up some memory bandwidth, then the decoded video is copied to a texture, then the texture is read for rendering onto the framebuffer, then the framebuffer is written to and finally the framebuffer is read for displaying, all using RGBA.
Of course that is about the worst possible implementation, but for 1280x1024@30fps on a 1920x1680, 60 Hz screen that would result in a bandwidth usage of 1280*1024*4*30*3+1920*1680*4*(30+60) > 1.2 GB/s
Keiyakusha
12th September 2009, 22:32
And how much GPU used with this example (http://kigaruna.bplaced.net/jw_revolt_test/test.htm)?
By the way I don't know about GPU, but my core2duo 2.6 ghz loaded on 50-60% while playing this... this is simple mp3.
LoRd_MuldeR
12th September 2009, 22:48
And how much GPU used with this example (http://kigaruna.bplaced.net/jw_revolt_test/test.htm)?
By the way I don't know about GPU, but my core2duo 2.6 ghz loaded on 50-60% while playing this... this is simple mp3.
No idea about the GPU usage, but CPU usage is at ~1% for the browser process. Not surprising for MP3 playback ;)
Keiyakusha
12th September 2009, 23:00
CPU usage is at ~1% for the browser process. Not surprising for MP3 playback ;)
Well, there should be visualizer, probably more GPU intensive then just videos. Window and tab with it should be active. Please tell me which browser you using? I'm using latest firefox 3.5.3 and I have50-60% cpu load when tab in browser is active and 40-50 when inactive...
LoRd_MuldeR
12th September 2009, 23:03
I'm using SeaMonkey 2.0b1pre, latest nightly build. My FlashPlayer version is 10,0,32,18. And I can so no visualization. Just two static lines !?
Sorry, I tried again and this time the visualization seems to work. Now I get ~20% CPU load.
Keiyakusha
12th September 2009, 23:18
LoRd_MuldeR
I began to think something is broken on my side ^_^ Thanks. Well 20% thats still a lot since you have Quad...
Anyway if someone can tell about GPU load while playing my example - I'm still interested.
CruNcher
13th September 2009, 00:11
Mainconcept seems to never got DXVA working after they implemented Elecards Code which had DXVA in a working state, it broke on the sync and now Nvidia is gonna help them to achieve direct GPU Playback on their VP2 for sure ATI support based on the UVD get's also implemented, though i doubt that will happen before Nvidias implementation so it's rather strange what some people seem to experience here and questionable in it's truth factor and for sure you gonna find Pre Versions of the GPU Decoding part first on Adobe Labs, maybe something in Win7's GPU Rendering goes wrong and utilizes the GPU here but that seems then to be a bug in Aero and no magically working GPU Decoding and not a good thing @ all ;)
Boolsheet
13th September 2009, 00:14
And how much GPU used with this example (http://kigaruna.bplaced.net/jw_revolt_test/test.htm)?
On the CPU I get a load of 5%-30% depending on the complexity of the visualization.
GPU-Z 0.3.4 reported about 1% for windowed and 4% in fullscreen. It's hard to meassure because it's not a constant load, there are peaks every other second and then it drops back to 0.
I'm on a i7 720 (@2.9 Ghz - HT on), ATI Radeon 4870 and IE8 (yeah I know, now put the torches away ;) ).
nm
13th September 2009, 00:58
Mainconcept seems to never got DXVA working after they implemented Elecards Code which had DXVA in a working state, it broke on the sync and now Nvidia is gonna help them to achieve direct GPU Playback on their VP2 for sure ATI support based on the UVD get's also implemented, though i doubt that will happen before Nvidias implementation
I doubt VPx/UVD usage would show up in these GPU load measurements anyway. Scaling and compositing can very well show up as this kind of load, depending on what Flash Player does and how the load is measured exactly.
St Devious
13th September 2009, 03:16
And how much GPU used with this example (http://kigaruna.bplaced.net/jw_revolt_test/test.htm)?
By the way I don't know about GPU, but my core2duo 2.6 ghz loaded on 50-60% while playing this... this is simple mp3.
here is the result. GPU jumped to 11 highest, but stayed at 1 normally
http://i27.tinypic.com/2hhds81.png
Keiyakusha
13th September 2009, 04:13
Nah... 11 thats some glitch. I don't see why there can be such high GPU load with videos, if this is not because of rendering step. Maybe it really uses smoothing/filtering.
Also note that in the case of MPC-HC there was some scaling involved even if video and display resolution match. That was fixed only in some recent revisions, so all is possible with flash.
benwaggoner
13th September 2009, 22:32
For what it's worth, Flash 10 can use the GPU for scaling the video and compositing, but H.263/H.264/VP6 decode is always software. This requires opt-in in the SWF to turn on that hardare acceleration.
Silverlight 3 is similar, although anecdotally it appears our hardware acceleration is on in more players and more robust and performant in general.
7oby
23rd September 2009, 14:27
At least for Linux on nVidia Hardware there is indeed GPU assisted Flash H.264 Decoding support:
http://www.phoronix.com/scan.php?page=news_item&px=NzU1MA
Theliel
24th September 2009, 00:36
CPU: 1%-6% and some peaks of 10-12%
GPU: ¿?
CPU i7 920 (2.66GHz HT - ON) + GPU: 7600GT + IE8 (similar result on FF 3.7a)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.