Original Post
Hello,
Let me preface this by saying I am NOT a very good DirectX programmer by any means. I know only enough to accomplish what I was attempting. Briefly, my application is reading frame buffers from a machine vision camera into a texture and processing it on the GPU via a pixel shader (v3) using Managed DirectX (v9...obsolete, I know). The pixel shader program processes the texture by analyzing neighborhoods of pixels in sizes of 5x5, 7x7 or 9x9 centered on the output pixel. The neighborhood is processed and the color of the output pixel is adjusted according to the result of the processing. More or less a convolution (in fact, not even that as I'm not doing any multiplications, just additions over the kernel window). At the same time, the application uses an open audio library called NAudio to play test tones (sine waves) in my app. The sine waves are simultaneously and intermittently computed on the UI thread and loaded into a circular buffer for audio output while the graphics processing is going on. This has been working very smoothly on my desktop machine (GeForce GTS 250 and core i5). I get real time frame rates, smooth updating and seamless audio output.
Yesterday I tried this same application on a core i7 laptop with an ATI Mobility Radeon HD 5470 and was surprised to see the graphics and audio performance deteriorate hugely. With the 5x5 neighborhood pixel shader the frame rates were fine and audio was good, but at 9x9 it slowed down to a fraction of the GeForce card in the desktop...about 5 frames a second, no exaggeration. In additon to this I got some pretty bad stuttering in the acoustic sine wave output. When I tax the GPU with larger convolution kernels the audio stuttering becomes really bad. The only time the audio is seamless and the frame rates are good is with the 5x5 kernel. The weird thing is that the convolution processing is occurring on the GPU (supposedly) whereas the audio sine wave generation is on the UI thread, so the larger kernel in the pixel shader shouldn't affect the audio processing. I've tried moving the audio processing to a secondary thread but that made no difference. I've also noticed that interface responsiveness slows down. It's almost as if the pixel shader is running on the CPU and not the GPU. Any ideas what may be going on here? This has me stumped. The device is created with HardwareVertexProcessing and it does support pixel shader 3, but has a max instruction slots value of 512. I've noticed that I am unable to instantiate the device on the laptop with the "PureDevice" argument as this causes an exception, but then again I wasn't using that argument for the desktop version either and that one screams.
Any thoughts anyone? Any help much appreciated!
-L
Let me preface this by saying I am NOT a very good DirectX programmer by any means. I know only enough to accomplish what I was attempting. Briefly, my application is reading frame buffers from a machine vision camera into a texture and processing it on the GPU via a pixel shader (v3) using Managed DirectX (v9...obsolete, I know). The pixel shader program processes the texture by analyzing neighborhoods of pixels in sizes of 5x5, 7x7 or 9x9 centered on the output pixel. The neighborhood is processed and the color of the output pixel is adjusted according to the result of the processing. More or less a convolution (in fact, not even that as I'm not doing any multiplications, just additions over the kernel window). At the same time, the application uses an open audio library called NAudio to play test tones (sine waves) in my app. The sine waves are simultaneously and intermittently computed on the UI thread and loaded into a circular buffer for audio output while the graphics processing is going on. This has been working very smoothly on my desktop machine (GeForce GTS 250 and core i5). I get real time frame rates, smooth updating and seamless audio output.
Yesterday I tried this same application on a core i7 laptop with an ATI Mobility Radeon HD 5470 and was surprised to see the graphics and audio performance deteriorate hugely. With the 5x5 neighborhood pixel shader the frame rates were fine and audio was good, but at 9x9 it slowed down to a fraction of the GeForce card in the desktop...about 5 frames a second, no exaggeration. In additon to this I got some pretty bad stuttering in the acoustic sine wave output. When I tax the GPU with larger convolution kernels the audio stuttering becomes really bad. The only time the audio is seamless and the frame rates are good is with the 5x5 kernel. The weird thing is that the convolution processing is occurring on the GPU (supposedly) whereas the audio sine wave generation is on the UI thread, so the larger kernel in the pixel shader shouldn't affect the audio processing. I've tried moving the audio processing to a secondary thread but that made no difference. I've also noticed that interface responsiveness slows down. It's almost as if the pixel shader is running on the CPU and not the GPU. Any ideas what may be going on here? This has me stumped. The device is created with HardwareVertexProcessing and it does support pixel shader 3, but has a max instruction slots value of 512. I've noticed that I am unable to instantiate the device on the laptop with the "PureDevice" argument as this causes an exception, but then again I wasn't using that argument for the desktop version either and that one screams.
Any thoughts anyone? Any help much appreciated!
-L