How to debug CUDA using eclipse Nsight with only one GPU

帅比萌擦擦* 提交于 2019-12-05 05:16:58

In general, it's not supported to debug on the same GPU that is hosting an X display. From the nsight getting started guide: "A GPU that is running X11 (on Linux) or Aqua (on Mac) cannot be used to debug a CUDA application and will be hidden from the application ran in the debugger. Such GPU can still be used for profiling GPU applications. "

I believe there is actually different behavior amongst different window managers, however. I have a laptop with Quadro1000M and RHEL 6.2 (with GNOME), with CUDA 5.0, and I am able to get into the debugger in nsight EE (Project...Build Project followed by Run...Debug). At that point I can step through and set breakpoints in host code. And if I run the code to completion I get proper output. However, you still can't debug device code. If you set a breakpoint in the device code (and hit that breakpoint), you will hang the X session.

EDIT: CUDA 5.5 and beyond now support the ability to debug on a single cc3.5 or higher GPU.

It seems that you can use CUDA 5.5 to debug CUDA programs in a machine with only one GPU. See section 1.7.3.2. CUDA-GDB of CUDA_Toolkit_Release_Notes

Another approach which might work is to use the onboard video output for the display. That way you use the onboard graphics for the display and the GPU for debugging.

For this you have to:

  • Go to BIOS and change the primary display adapter to "On-Board" (this varies from manufacturer to manufacturer)
  • Physically connect you display to the on-board display output feed
  • Restart and then run Nsight

If you are using a system with no on-board graphics, then you are out of luck!

This guy here has been able to get it up and running in Windows with Visual studio and Nsight plugin.

P.S. You would probably need to edit your xorg.conf to make X use onboard graphics instead of your Nvidia GPU.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!