How to debug CUDA using eclipse Nsight with only one GPU

瘦欲@ 提交于 2019-12-07 00:33:24

问题


I'm getting an error: "all cuda devices are used for display and cannot be used while debugging" (Using Ubuntu)

Is there ANY way to use Nsight eclipse with only one GPU for debugging? I have seen solutions like "sudo service lightdm stop" to kill X but that kills Nsight eclipse too so what's the point?

Update: Since it is not possible to debug with the same GPU that runs X, I have to ask: How does one go about using ANOTHER computer in his home network to "remotely" access Ubuntu in such a way that the X desktop rendering will be performed by the Guest computer while letting the host GPU run the debugger?


回答1:


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.




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/13662491/how-to-debug-cuda-using-eclipse-nsight-with-only-one-gpu

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