nSight 4.1 - can't see HLSL shader code, only ASM
Greetings everyone, I'm having trouble debugging my DX11 code. I use VS2013 Update 3, Win 8.1 x64, drivers 340.52, GTX 580. I need to step through shader and see what's wrong. First I could not get nSight to run with my app (solved by removing DEBUG flag from device creation, weird though), now when I want to step through shader code, Shader List shows shaders (all named as "No Name"), they also have debug information present and I can step through them, but all of them are in ASM. Why is that so? I use D3DCompileFromFile to compile shaders, compile flags for my debug build are D3DCOMPILE_ENABLE_STRICTNESS | D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION | D3DCOMPILE_WARNINGS_ARE_ERRORS, but changing them had no effect. Please help, I need to step through HLSL. Thank You very much!
Greetings everyone,

I'm having trouble debugging my DX11 code. I use VS2013 Update 3, Win 8.1 x64, drivers 340.52, GTX 580. I need to step through shader and see what's wrong. First I could not get nSight to run with my app (solved by removing DEBUG flag from device creation, weird though), now when I want to step through shader code, Shader List shows shaders (all named as "No Name"), they also have debug information present and I can step through them, but all of them are in ASM. Why is that so? I use D3DCompileFromFile to compile shaders, compile flags for my debug build are D3DCOMPILE_ENABLE_STRICTNESS | D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION | D3DCOMPILE_WARNINGS_ARE_ERRORS, but changing them had no effect. Please help, I need to step through HLSL.


Thank You very much!

#1
Posted 08/20/2014 12:55 PM   
Hi Jofo, Please try this macros: D3DCOMPILE_PREFER_FLOW_CONTROL | D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION. If it still have issue, it's better to have your sample to do more detail investigate. Thanks An
Hi Jofo,

Please try this macros: D3DCOMPILE_PREFER_FLOW_CONTROL | D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION. If it still have issue, it's better to have your sample to do more detail investigate.

Thanks
An

#2
Posted 08/22/2014 07:10 AM   
I tried also with those flags, but the result is the same... I will try it on a different computer and GPU.
I tried also with those flags, but the result is the same... I will try it on a different computer and GPU.

#3
Posted 08/25/2014 11:16 AM   
I am having the same issue, I use D3DCompile with flags D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION | D3DCOMPILE_PREFER_FLOW_CONTROL to save a shader binary to a file and then read in this file at runtime. Is it possible that using D3DCompile instead of the legacy function D3DXCompileShader as stated in the documentation causes this issue?
I am having the same issue, I use D3DCompile with flags D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION | D3DCOMPILE_PREFER_FLOW_CONTROL to save a shader binary to a file and then read in this file at runtime.

Is it possible that using D3DCompile instead of the legacy function D3DXCompileShader as stated in the documentation causes this issue?

#4
Posted 10/27/2014 07:33 PM   
Hi TedYBear, D3DXCompileShader should do exactly same job as D3DCompile, if you are in the same d3dcompiler_xx.dll. D3DXCompileShader just make shader compile job easier. I am think there should be something else for your issue, also please note, Nsight don't support shader debug on D3D9 samples. Thanks An
Hi TedYBear,

D3DXCompileShader should do exactly same job as D3DCompile, if you are in the same d3dcompiler_xx.dll. D3DXCompileShader just make shader compile job easier.

I am think there should be something else for your issue, also please note, Nsight don't support shader debug on D3D9 samples.

Thanks
An

#5
Posted 10/28/2014 03:34 AM   
Hi, It looks like I am having exactly the same issue. Compiling at runtime using D3DCompileFromFile with D3DCOMPILE_ENABLE_STRICTNESS | D3DCOMPILE_DEBUG | D3DCOMPILE_PREFER_FLOW_CONTROL | D3DCOMPILE_SKIP_OPTIMIZATION As above I can debug shaders but only see the asm. While this is functional I would like to solve this problem and make my life a little easier. Please let me know what info I can provide that would help work out what the problem is. Some details: Windows 7 x64 VisualStudio 2010 DirectX 11.0, using Windows 8.1 SDK, x86 target d3dcompiler_47.dll Nvidia GT 640 Driver Version: 344.60 Nsight ver: 4.1, build number 4.1.0.14255 cheers Claude
Hi,

It looks like I am having exactly the same issue. Compiling at runtime using D3DCompileFromFile with D3DCOMPILE_ENABLE_STRICTNESS | D3DCOMPILE_DEBUG | D3DCOMPILE_PREFER_FLOW_CONTROL | D3DCOMPILE_SKIP_OPTIMIZATION

As above I can debug shaders but only see the asm. While this is functional I would like to solve this problem and make my life a little easier. Please let me know what info I can provide that would help work out what the problem is.

Some details:

Windows 7 x64
VisualStudio 2010
DirectX 11.0, using Windows 8.1 SDK, x86 target
d3dcompiler_47.dll
Nvidia GT 640
Driver Version: 344.60
Nsight ver: 4.1, build number 4.1.0.14255

cheers
Claude

#6
Posted 11/06/2014 01:38 AM   
Hi Hecatoncihires, It's better to have your sample for some local investigation. Thanks An
Hi Hecatoncihires,

It's better to have your sample for some local investigation.

Thanks
An

#7
Posted 11/06/2014 03:01 AM   
Ok, I presume the saved capture solution will do the job. I have a extremely simple test case, let me know where I can drop it for you.
Ok, I presume the saved capture solution will do the job. I have a extremely simple test case, let me know where I can drop it for you.

#8
Posted 11/06/2014 03:41 AM   
Hi, I assume the 'saved capture solution' you mean the serialized project from nsight, I am afraid it may not suit for solve your issue about compile shaders. please show some sample which can repro your issue directly, that may save many time. can you share me your email, I can send some ftp address to you. Thanks An
Hi,

I assume the 'saved capture solution' you mean the serialized project from nsight, I am afraid it may not suit for solve your issue about compile shaders. please show some sample which can repro your issue directly, that may save many time.

can you share me your email, I can send some ftp address to you.

Thanks
An

#9
Posted 11/06/2014 09:35 AM   
I'm curious as to what the result of your test is! My code is not very trivial, but I'll try to create a reproduction project over the weekend when I have time.
I'm curious as to what the result of your test is! My code is not very trivial, but I'll try to create a reproduction project over the weekend when I have time.

#10
Posted 11/07/2014 02:49 AM   
PM sent on the 7th. For the record I found this sample from MS https://code.msdn.microsoft.com/windowsdesktop/Direct3D-Tutorial-Win32-829979ef that (making sure to set the flags correctly as above) suffers exactly the same problem, so no point spending time stripping down what you or I have as an example. This is about as simple as it gets. No reply so far, but would very much like to move this along. Precompiling my shaders is on my todo list but if this can be made to work then it's priority drops significantly.
PM sent on the 7th. For the record I found this sample from MS


https://code.msdn.microsoft.com/windowsdesktop/Direct3D-Tutorial-Win32-829979ef


that (making sure to set the flags correctly as above) suffers exactly the same problem, so no point spending time stripping down what you or I have as an example. This is about as simple as it gets.

No reply so far, but would very much like to move this along. Precompiling my shaders is on my todo list but if this can be made to work then it's priority drops significantly.

#11
Posted 11/11/2014 09:53 AM   
Hi Hecatonchires, The sample you mentioned works smoothly on my side, I tried both the default flags in this Direct3D-Tutorial and the flags Nsight Shader Debug required [as mentioned above], I can set bp and get the corresponding variables in shaders as expected. I am thinking that maybe some other issue in your side which block your shader debug: - your driver - your nsight version - your gpu Please make sure these 3 are up-to-date. Thanks An
Hi Hecatonchires,

The sample you mentioned works smoothly on my side, I tried both the default flags in this Direct3D-Tutorial and the flags Nsight Shader Debug required [as mentioned above], I can set bp and get the corresponding variables in shaders as expected.

I am thinking that maybe some other issue in your side which block your shader debug:
- your driver
- your nsight version
- your gpu

Please make sure these 3 are up-to-date.

Thanks
An

#12
Posted 11/12/2014 03:37 AM   
Hi AYan, Driver and Nsight are up to date, version 344.65 and 4.1.0.14255 respectively. My gpu was a GT 640 which wasn't explicitly named on the list of supported cards, so I have installed a GTX 680 which is and am still not seeing any shader source. I have always been able to set breakpoints and look at register variables in the watch window, I just don't have the hlsl source available. What version of Visual Studio did you use to test? As mentioned above I am using VS2010 SP1. I'm at a loss as to how to debug this further, do you have any suggestions? thanks Claude
Hi AYan,

Driver and Nsight are up to date, version 344.65 and 4.1.0.14255 respectively. My gpu was a GT 640 which wasn't explicitly named on the list of supported cards, so I have installed a GTX 680 which is and am still not seeing any shader source.

I have always been able to set breakpoints and look at register variables in the watch window, I just don't have the hlsl source available.

What version of Visual Studio did you use to test? As mentioned above I am using VS2010 SP1. I'm at a loss as to how to debug this further, do you have any suggestions?

thanks
Claude

#13
Posted 11/12/2014 07:27 AM   
Interestingly if you save a frame capture then you can see that the hlsl source is in the .bin file generated. So my guess would be that it isn't a compilation problem.
Interestingly if you save a frame capture then you can see that the hlsl source is in the .bin file generated. So my guess would be that it isn't a compilation problem.

#14
Posted 11/12/2014 08:12 AM   
Hi Hecatonchires, I am on vs2010 sp1 also. I am guessing something maybe related with your settings: Nsight->Options->Graphics - Force assembly debugging -> False - Show disassembly if source does not exist -> Ask Please check your settings, wish this can show some help. Thanks An
Hi Hecatonchires,

I am on vs2010 sp1 also. I am guessing something maybe related with your settings:

Nsight->Options->Graphics
- Force assembly debugging -> False
- Show disassembly if source does not exist -> Ask

Please check your settings, wish this can show some help.

Thanks
An

#15
Posted 11/13/2014 04:20 AM   
Scroll To Top

Add Reply