🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

DirectX & OpenCL & pixel shaders cooperation

Started by
3 comments, last by _WeirdCat_ 5 years, 7 months ago

Hello!

I'm a simple user, not a developer, but I need help on an issue that requires a developer's level of expertise.

Briefly, I'm running a program that is using Direct3D, OpenCL and pixel shaders at the same time. Cooperation of these 3 entities leads to a critical decrease of performance, which begins a couple of minutes after the program startup.

Now, the details. I'm running a video player with a frame interpolator and a 3rd party video renderer attached to it. The frame interpolator uses OpenCL for its functioning and the renderer uses Direct3D9. In addition to that, certain image processing algorithms in the renderer are implemented as pixel shaders, so when you activate them, shaders also start running.

But when I activate these shaders, a trouble happens. For the first couple of minutes the player runs smoothly, but after that CPU load suddenly rises and the renderer starts dropping frames of video. I know it's the renderer because it shows on screen statistics with the renderer frame queue among them, and the queue gets almost empty at that moment. There's also the decoder queue, which precedes rendering queue, and sometimes it gets empty too.

I've been trying to solve the problem by switching different settings, but it's useless, which leads me to the conclusion that source of the problem lies on a lower level than the programs themselves, I guess in the APIs. As the trouble doesn't begin at once, I presume that there is some memory buffer somewhere in this chain, which starts to fill with movie playback beginning and when it overflows, frames start dropping.

I need to track the source of this problem. If these symptoms give you an idea of what's going on, tell me. If not, tell me what tools can make a low-level diagnostics to find the source and how to use them for this purpose. I've already tried running CodeXL on the player's process, but somewhy it's not able to capture OpenCL calls, like they are not there. 

If you need additional information, tell me. If you can't give any good advice, be quiet - I need real help here, not useless chit-chat so common on the internet.

Advertisement

OpenCL can run on CPU as well. Maybe the app allows you to choose which device to use (eventually by editing a config file manually.)

You can also try to add a second GPU. With luck (or manual configuration as above) one app picks that and the problem disappears. 

Sounds more like buffers not able to keep up, maybe a slow harddrive or something?
If the issue is with the APIs, it's how the software uses them and not the APIs themselves that is bugged..

.:vinterberg:.

My bet would be either the sync problem, or you are creating new  buffers each frame, or you process bigger amount of data instead of one frame per draw? Or even you somewhere add some kind of information like (this is an object 1, save it for further processing) now in another frame you add x more objects to process them further and so on

This topic is closed to new replies.

Advertisement