4

I know I can debug CUDA on linux using cuda-gdb without GUI, but that's not really convenient. I also know that one can debug CUDA with Nsight Eclipse edition if X server is running on other GPU. So I have dual GPU laptop (geforce 525m and Intel 3000) and I was wondering if I could run X server on Intel card while my CUDA code runs on my nvidia card?

Robert Crovella
  • 120,849
  • 8
  • 160
  • 206
Ognjen Kocic
  • 108
  • 2
  • 9
  • It's not a problem in Windows, single GPU debugging is supported on that platform... I'm looking for a possible workaround on Ubuntu that will provide GUI debugging... – Ognjen Kocic Oct 23 '13 at 12:14
  • Certainly if we were talking about for example a desktop system with a separate NVIDIA GPU (and intel integrated graphics) then it's possible and pretty simple, just need a proper `xorg.conf` file. It may be possible on your laptop, but it depends on exactly how the system BIOS manages the GPU hardware. In my opinion, configuration specifics for your laptop are off-topic for StackOverflow. – Robert Crovella Oct 23 '13 at 17:34
  • It's not just my laptop specific configuration. Many laptops have nvidia optimus GPUs in combination with Intel discrete card. If you know how to set up xorg.conf for my laptop that will very likely be applicable to other laptops as well. – Ognjen Kocic Oct 23 '13 at 18:52
  • Not all optimus laptops are the same even in the graphics area. For example some offer the option of giving the user manual control of powering up the dGPU. Some do not. And again I believe working through all this is off-topic. My opinion. – Robert Crovella Oct 23 '13 at 21:47

3 Answers3

2

If you want to try to make this work on your laptop, you should first ensure that your xorg.conf file references only the Intel integrated GPU.

Then you will need to try and determine if the laptop is powering up both the Intel integrated GPU and the NVIDIA discrete GPU when you are running under linux. For this test I would start by running lspci If that command shows both the intel graphics and the NVIDIA GPU, then you could try installing the CUDA toolkit at that point. Be sure to answer "no" when it asks if you want to update the xorg.conf file.

After that it may just work. If it doesn't work, you probably want to inspect your SBIOS machine configuration options to see if there is a way you can force-enable both the NVIDIA GPU and the Intel graphics.

If you are able to get the display hosted by the Intel graphics, and the CUDA toolkit loaded and functional, then you should have no problems debugging on that NVIDIA GPU.

Robert Crovella
  • 120,849
  • 8
  • 160
  • 206
  • Thank you for all the suggestions. There is also one more thing. When I want to start CUDA application I need to start it with optirun command. So in latest bumblebee (3.2.1) there is --no-xorg option that will make sure that optirun doesn't start another X server. This option will be my next move. I've moved to Kubuntu 13.10 and I'll try to make it work. – Ognjen Kocic Oct 25 '13 at 18:13
0

I'm answering because I can't post comments yet.

I'm not sure about it, but I think it is not a problem on Debian. 2 months ago I was using Debian instead of Ubuntu (CUDA 5.0) and was able to use X server and use cuda-gdb (I'm not sure if it was possible to debug inside kernel functions, but I THINK so).

When changed to Ubuntu with CUDA 5.5, I need to start Ubuntu in text mode to debug inside kernel functions.

So, if you can try, I suggest to try with Debian. :)

Blufter
  • 87
  • 1
  • 12
  • Did you have more than one GPU? Did you debug using command line cuda-gdb, or using Nsight Eclipse debugger? – Ognjen Kocic Oct 23 '13 at 15:09
  • @OgnjenKocic, i have only one GPU (GTX 480). To debug i use cuda-gdb, but i was able to run the profiler Nvidia Visual Profiler and debug the program (via cuda-gdb) on the same session. – Blufter Oct 23 '13 at 18:37
  • Yes you can profile your CUDA code for better performance, but you cannot use Nsight Eclipse GUI debugger with single GPU with compute capability less than 3.5 (which only few GPUs have). That is already answered in http://stackoverflow.com/questions/13662491/how-to-debug-cuda-using-eclipse-nsight-with-only-one-gpu ... – Ognjen Kocic Oct 23 '13 at 18:45
  • Wow, Thanks for the link. I was just trying to help and look that, instead teach something, i learned somethin. haha. Thanks. – Blufter Oct 24 '13 at 14:43
0

In my opinion this solution isn't fine,but it work on Ubuntu 16.04 at notebook ASUS B400V.

  1. Start XServer using Intel Graphic card (Nvidia XServer setting or sudo prime-select intel; you need log out and log in).
  2. Run command sudo prime-select nvidia and no logout.
  3. Run command sudo tee /proc/acpi/bbswitch <<< ON

After performing this steps I can debug my CUDA program. Before rebooting or logout you need run command sudo prime-select intel.

sema
  • 1