12

I am using Ubuntu 14.04LTS, with an Intel CPU + integrated graphics, with a GTX650 GPU. I asked this question on SO but they said it was offtopic.

I want to use my GPU for debugging CUDA code and for that I need to change display to integrated only. This is the error I get when I try to debug it currently:

"All cuda devices are used for display and cannot be used while debugging"

I went into the BIOS and switched primary display to iGPU (the integrated one, HD4600). Nothing came out of the GPU ports anymore (in terms of display) and I plugged my monitors into the motherboard. Only one of the monitors works. Normally I have them like:

|[Monitor 1, VGA]| |[Monitor 2, DVI]|

In that configuration, with iGPU, nothing is displayed on Monitor 1 (it's black, but the computer knows it's there - the green light is on and all my windows open on it). The only way to get it to work is to swap Monitor 2 to VGA and Monitor 1 to DVI.

If I enter lspci | grep VGA into Terminal, I get this:

00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1)

Running xrandr gives me:

Screen 0: minimum 8 x 8, current 3360 x 1050, maximum 16384 x 16384
DVI-D-0 disconnected primary (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
VGA1 connected 1680x1050+0+0 474mm x 296mm
   1680x1050      60.0*+
   1600x1000      60.0 +
   1280x1024      75.0     72.0     60.0  
   1440x900       75.0     59.9  
   1152x864       75.0  
   1024x768       75.1     70.1     60.0  
   800x600        72.2     75.0     60.3  
   640x480        75.0     72.8     66.7     60.0  
   720x400        70.1  
DP1 disconnected
HDMI1 disconnected
HDMI2 connected 1680x1050+1680+0 474mm x 296mm
   1680x1050      60.0*+
   1600x1000      60.0 +
   1280x1024      75.0     72.0     60.0  
   1440x900       75.0     59.9  
   1152x864       75.0  
   1024x768       75.1     70.1     60.0  
   800x600        72.2     75.0     60.3  
   640x480        75.0     72.8     66.7     60.0  
   720x400        70.1  
HDMI3 disconnected
VIRTUAL1 disconnected

It isn't an HDMI connection, I don't know why it thinks it is. With the GPU, it knows it's DVI. Anyway...

This is the xorg.conf (if I change it, it just overwrites it):

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "intel"
    Driver "intel"
    BusID "PCI:0@0:2:0"
    Option "AccelMethod" "SNA"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1@0:0:0"
    Option "ConstrainCursor" "off"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration" "on"
    Option "IgnoreDisplayDevices" "CRT"
EndSection

This is my 10-monitors.conf file in /usr/share/X11/xorg.conf.d/:

  GNU nano 2.2.6                                      File: /usr/share/X11/xorg.conf.d/10-monitors.conf                                                                                   

Section "Monitor"
    Identifier     "VGA1"
EndSection

Section "Monitor"
    Identifier     "HDMI2"
EndSection

Section "Device"
   Identifier      "intel0"
   Driver          "intel"
   BusID           "PCI:0@0:2:0"
EndSection

Section "Device"
   Identifier      "intel1"
   Driver          "intel"
   BusID           "PCI:0@0:2:0"
EndSection

Section "Screen"
   Identifier     "Screen0"
   Device         "intel0"
   Monitor        "VGA1"
   DefaultDepth   24
   SubSection     "Display"
      Depth       24
      Modes       "1680x1050" "1920x1080"
   EndSubSection
EndSection

Section "Screen"
   Identifier     "Screen1"
   Device         "intel1"
   Monitor        "HDMI2"
   DefaultDepth   24
   SubSection     "Display"
      Depth       24
      Modes       "1680x1050" "1920x1080"
   EndSubSection
EndSection

This still doesn't permit my CUDA code to be debugged. If I run lsof /dev/nvidia* I get:

COMMAND  PID     USER   FD   TYPE  DEVICE SIZE/OFF  NODE NAME
compiz  1659 cinnamon  mem    CHR 195,255          11805 /dev/nvidiactl
compiz  1659 cinnamon  mem    CHR   195,0          11806 /dev/nvidia0
compiz  1659 cinnamon   11u   CHR 195,255      0t0 11805 /dev/nvidiactl
compiz  1659 cinnamon   12u   CHR   195,0      0t0 11806 /dev/nvidia0
compiz  1659 cinnamon   13u   CHR   195,0      0t0 11806 /dev/nvidia0
compiz  1659 cinnamon   14u   CHR   195,0      0t0 11806 /dev/nvidia0

So I guess Compiz (X server?) is using it still. How do I stop it from using it?

  • 1
    I assume you're using proprietary nvidia drivers? Perhaps trying different versions could help? (Try 384,387?) Also, what CUDA are you developing with? I haven't tried on 14.04, but I'm using CUDA8.0.61 on 17.04 with a 970M nvidia-384. (No iGPU here) – Robobenklein Jan 11 '18 at 19:40
  • 1
    Also good to check would be the intel xserver drivers. I would try with the minimal amount of monitors plugged in, and ensure that the nvidia controls aren't being activated with the Xserver. (Look in the Nvidia GUI utility while X is running and see what shows there.) Also worth checking is nvidia-debugdump -l -v -z to see how your system is recognizing your card. – Robobenklein Jan 12 '18 at 4:45
0

I have had success with a dual monitor setup, with one connected to my dedicated ATI GPU and the other connected to the i7-2600K iGPU.

In order to do so I ran

xrandr --setprovideroutputsource 1 0

It used to work flawlessly but it is still considered experimental, and with several kernel upgrades since then YMMV.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.