Hi!
I'm using Compute Shaders 5 to develop GPGPU application which has no Graphics pipeline and CS is running in Dispatch pipeline only. I'm very interested in DX11 Compute Shader debugging capabilities provided by GPU PerfStudio 2.X and wondering if it is possible to use it for applications with Dispatch pipeline.
I've tried PerfStudio 2.1 to debug BasicCompute11 sample from DX SDK (February 2010), but didn't succeed - client reported error "Unable to attach to current application. Please make sure it is using a supported graphics API", while server printed these messages:
GPU PerfStudio Server - Version V2.1.719
Message: Server : Using Logfile: D:/GPUPerfStudio2.1/Server-Win32/pslog.txt
Message: Server : Succesfully enabled DX Peformance Counters in Driver
Message: Server : Available Wrappers:
Message: Server : DX10Server.dll V2.1.719 DX10
Message: Server : DX11Server.dll V2.1.719 DX11
Message: Server : GLServer.dll V2.1.719 OpenGL
Message: Server : Starting web server on port 80
Message: Server : About to launch: C:\Program Files\Microsoft DirectX SDK (February 2010)\Samples\C++\Direct3D11\Bin\x86\BasicCompute11.exe
Message: Server : Params:
Message: Server : Working Directory:
Creating device...Message: Server : 0: 127.0.0.1 - /Process.xml
done
Creating Compute Shader...done
Creating buffers and filling them with initial data...done
Creating buffer views...done
Running Compute Shader...done
Verifying against CPU result...succeeded
Cleaning up...
Message: Server : 1: 127.0.0.1 - /Process.xml
Message: Server : 2: 127.0.0.1 - /Process.xml
Message: Server : 3: 127.0.0.1 - /Process.xml
Message: Server : 4: 127.0.0.1 - /Process.xml
Message: Server : 5: 127.0.0.1 - /Process.xml
Message: Server : 6: 127.0.0.1 - /Process.xml
Currently, GPU PerfStudio expects to find a call to ID3D11Device::Present() in order to identify the end of a frame. Similarly, it expects that the application is conntinually rendering. Since BasicCompute11 does not loop, it does not work with GPU PerfStudio 2. You should be able to put a loop in your application and a call to Present() in order to make it work correctly.
Please let us know if you continue to have trouble with it.
I also want to debug a compute shader so I tested your suggestion (see code). This way PerfStudio is able to analyze the frame and it is also possible to view UAVs for the shader etc. and to debug it.
But debugging doesn't work that well. I have a function call within the main function of the shader which is not executed. And only one thread was debugged although I said the shader that two should be started. And then there are also the genereal debugging disadvantages of PerfStudio (no possibility to add watches, etc.)
Would be really nice to see improvements in shader debugging for all shader stages in the future.
while (true) { d3dContext->Dispatch(1,1,1); IDXGISwapChain* chain = DXUTGetDXGISwapChain(); chain->Present(0,0); }
The function within the main function is being executed, but the debugger may not be able to correctly step into the function. To help the DX runtime provide more information, please also include these flags when compiling your shader (or try to debug at the ASM level):
D3D10_SHADER_PREFER_FLOW_CONTROL | D3D10_SHADER_SKIP_OPTIMIZATION
The threads are evaluated in parallel. Since your group size is set to 2, the Draw Mask and Register Buffer on the right side of the Shader Debugger window should be a 2x1 (or 1x2) rectangle, and if you click in that buffer, you can select which Thread you are viewing result values for. If you've selected a different thread, the register table will update to show the values specific to the selected thread (and the values for "thread" will change).
By default we show all input and local variables (or registers) in the table below the code. Currently structures and arrays are not supported. Since all the available data is displayed by default, is there something else that you'd want to add a watch to?
If there are any features that you'd like to see implemented, let us know so that we can include them in our roadmap.
Thank you for the additional information. I will recheck this soon and then report you my results.
I wanted to check if it works with takting your suggestions into account but when I press the Debug-Button of the CS-Code window within PerfStudio my apps crashes now and windows says the problemm occured in the atidxx32.dll.
Since my last test I updated the Catalyst driver from 10.2 to 10.4 - could it be a bug in the driver?
I've downloaded and installed the latest version of GPU PerfStdio.
I'm trying to debug Compute Shaders, but I get an error every time
"No registers found in XML
Please make sure the object is being rendered on screen".
It's GPU computations, so I don't render anything. How does it work? What should I do for that?
Also, if I try to debug ASM compute shaders I get errors:
"DDSPixelFormat: Init Arithmetic operation resulted in an overflow"
"DDS:Read:LoadImageData Value cannot be null. Parameter name: dst"
"CS Shader Debugger: DataManagerCallback: Callback failed handling multiple commands: Reason: Object reference not set to an instance of an object"