11 Replies Latest reply on Nov 25, 2018 10:54 AM by vpupkin

    Direct3D & OpenCL & pixel shaders cooperation problem

    vpupkin

      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.

        • Re: Direct3D & OpenCL & pixel shaders cooperation problem
          dorisyan

          Hello dipak, could you help to contact the DX/OpenCL team?

            • Re: Direct3D & OpenCL & pixel shaders cooperation problem
              dipak

              From the above description, it is not clear whether the issue is related to OpenCL or DX or both. Hence, first I would suggest vpupkin to use some profiling/debugging tools like RenderDoc , GPUView to check if he can identify any bottleneck or any suspected region. Based on the observation, I can report to the appropriate team. Otherwise, I need a repro to open a ticket.

               

              Thanks.

                • Re: Direct3D & OpenCL & pixel shaders cooperation problem
                  vpupkin

                  I've already said that I tried running CodeXL. I tried running RenderDoc as well, but the result was similar - nothing was displayed in program window and there were no messages of any kind like if that program wasn't using the APIs at all.

                  Can you tell me why these monitoring tools don't capture anything?

                    • Re: Direct3D & OpenCL & pixel shaders cooperation problem
                      dipak

                      I'm not sure why these tools failed to capture any information. Please try GPUView once. Also please provide a repro to investigate the problem.

                        • Re: Direct3D & OpenCL & pixel shaders cooperation problem
                          vpupkin

                          As for GPUView, I'm not installing non-open source programs, so I want to find out what's wrong with those I have. I can provide additional information if you guide me in troubleshooting them. As for repro, I don't know what it is.

                            • Re: Direct3D & OpenCL & pixel shaders cooperation problem
                              dipak

                              "Repro" means a reproducible test-case. Please provide a complete test-case that manifests the issue.

                               

                              By the way, GPUView is a development tool for determining the performance of the graphics processing unit (GPU) and CPU. It is part of Windows Performance Toolkit (WPT). Sometimes GPUView traces are useful to find any performance bottleneck.

                                • Re: Direct3D & OpenCL & pixel shaders cooperation problem
                                  vpupkin

                                  First, will you guide me with troubleshooting those programs or not? This was my main question.

                                  Second, how can I give you a reproducible case? Do you need a piece of video that is suffering from frame drops? Then what will you do with it? Will you install all the programs that I have installed to reproduce it?

                                  And last, I've said that I won't be using GPUView, so I don't need any explanations of it.

                                    • Re: Direct3D & OpenCL & pixel shaders cooperation problem
                                      dipak

                                      As I already said, I'm not sure why CodeXL and RenderDoc couldn't capture any profiling information in this case. For any help regarding these tools, I would suggest you to check their related support forums here:

                                      Issues · GPUOpen-Tools/CodeXL · GitHub --- for CodeXL

                                      Issues · baldurk/renderdoc · GitHub  ---- for RenderDoc

                                       

                                      We have a separate team that reproduces and validates the user reported issues. If I get a reproducible test-case, I can forward it to them. The package should include following details:

                                      1. a standalone application or executable
                                      2. any dependent files and settings that are required to run the executable
                                      3. target setup information
                                      4. steps to reproduce the issue
                                      5. expected behavior with/without issue [i.e. how to detect the issue if reproducible]

                                       

                                      [Note: It is recommended to provide the test-case as simple as possible and remove any redundant files that are not directly related to the issue.]

                                       

                                      If the package size is large, please upload the package to a public file repository and share us the download link. If privacy is concerned, you can send me the download link (and password, if any) via private message or email.

                                       

                                      Thanks.

                                        • Re: Direct3D & OpenCL & pixel shaders cooperation problem
                                          vpupkin

                                          I want to make it clear. So you are an AMD employee and you have a team that investigates the user issues, is that correct? If so, how do these issues need to be related to AMD in order to be investigated? Does the issue have to be happening with the AMD implementation of OpenCL or DirectX (or DirectX is fully implemented in Windows, not on the GPU?) on AMD GPU? And the last - how long does this team exist and why did you decide to create it? And can a user with an issue report to it directly in some way?

                                            • Re: Direct3D & OpenCL & pixel shaders cooperation problem
                                              dipak

                                              So you are an AMD employee and you have a team that investigates the user issues, is that correct?

                                              Actually the team, which I referred in my previous post, only tries to reproduce and validate the user reported issue. If success, then they report it to appropriate engineering team for detail investigation.

                                               

                                              how do these issues need to be related to AMD in order to be investigated...

                                              The issue needs to be related to AMD implementation only. During investigation, if scope of the issue appears outside AMD scope (e.g. application specific logical issue, third-party tool/software issue, non-AMD hardware/software issue  etc.), no further investigation is done.  

                                               

                                              And the last - how long does this team exist and why did you decide to create it?

                                              I don't know when the team was created, however, as I mentioned earlier, the main purpose of the team is to reproduce and validate the user reported issue and then take the action accordingly. By doing so, many invalid issues can be eliminated at early stage and it saves lot of engineering time.

                                               

                                              And can a user with an issue report to it directly in some way?

                                              The team provides back-end support and usually does not interact with the users directly.

                                              By the way, other than this Developer community, we have a support forum  here to report a hardware and software related issue.

                                              Also, one can report an issue by submitting a bug reporting form here: AMD Issue Reporting Form

                                               

                                              I don't know how the above information is related to the problem and helps you, still I tried to answer them as much as possible.

                                               

                                              Thanks.

                                                • Re: Direct3D & OpenCL & pixel shaders cooperation problem
                                                  vpupkin

                                                  I see.

                                                  This information was important for me for 2 reasons.

                                                  First, I was interested in the way that AMD handles their users' problems. I recently had to deal with Intel's support on a different issue and I wanted to compare the quality of support.

                                                  Second, your answer implies that your team won't help me because I have a laptop with an NVidia GPU and Intel CPU. When I joined this forum, I didn't search for support from AMD actually, but for a forum of graphics developers and a link to here was one of the results in the search engine.

                                                  As for my issue, I've recently resolved it in an unexpected way. The video demuxer in my player wasn't capable to do the hardware acceleration (there is DXVA included in it) with the frame interpolator working somewhy. I tried a different one which included other HWA options and one of them (NVidia CUVID) worked! The CPU load decreased and now frames hardly ever drop.

                                                  Before I did this, the CPU load wasn't too high though. There were only short pikes of load when one of the cores was 100% loaded, and I supposed that big queue sizes set for the filters in the filter graph would compensate for this. But they didn't. Why so?