7

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?

alonhzn
  • 150
  • 1
  • 7
  • If you have physical control of the machine, you can add a generic, inexpensive graphics card and run X on it, to free up the GPU for debugging. – Roger Dahl Dec 02 '12 at 05:42

3 Answers3

5

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.

Robert Crovella
  • 143,785
  • 11
  • 213
  • 257
  • Thanks, I wasted many hours to install ubuntu, learn how to use it and configure it - just to find that out now. They should write this warning in BLINKING RED BOLD letters... – alonhzn Dec 01 '12 at 20:34
  • I know that you stated "only one GPU" in the question. However if by chance you have a (desktop) system that has graphics integrated into the motherboard, then it's not very difficult to move the X display to that and leave the CUDA GPU with no display. You can then run nsight EE nicely. – Robert Crovella Dec 01 '12 at 22:29
  • Unfortunately I don't. But in case some one does, I found an explanation on how to configure it: http://www.onextrabit.com/view/50310aea65e7d250c5000002 – alonhzn Dec 02 '12 at 13:39
  • I was able to turn this on in Nsight by going to Window -> Preferences -> Nsight and checking the box to enable cuda software preemption debugging. – Aaron Swan Jul 05 '19 at 16:56
1

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

warunapww
  • 966
  • 4
  • 18
  • 38
  • 3
    The **software_preemption** feature requires a device with compute 3.5 capability (GK110), which are currently pretty high end. In a couple of years these devices will be pretty common though. – Freerobots Aug 24 '13 at 21:10
  • Currently it means that only GTX Titan and GTX 780 Geforce cards support this. So it is way out of reach for enthusiasts and hobbyists.:( – Shayan RC Dec 18 '13 at 04:04
  • 1
    @Shayan RC: interestingly according to CUDA GPUs website GeForce GT 640 (GDDR5) card has CC 3.5. There are also recently released Maxwell cards GeForce 750 & 750 Ti with CC 5.0, so these should support software preemption as well. – Grzegorz Szpetkowski Mar 01 '14 at 19:46
0

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.

Shayan RC
  • 3,152
  • 5
  • 33
  • 40