配置Xorg以从集成GPU工作


11

我正在使用具有Intel CPU +集成显卡和GTX650 GPU的Ubuntu 14.04LTS。我在SO上问了这个问题,但他们说这是题外话。

我想使用我的GPU调试CUDA代码,为此,我需要将显示更改为仅集成。这是我目前尝试对其进行调试时遇到的错误:

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

我进入BIOS,并将主显示器切换到iGPU(集成显示器,HD4600)。(从显示方面)GPU端口再也没有任何问题,我将显示器插入主板。只有一台显示器可以工作。通常我有他们喜欢:

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

在这种配置下,使用iGPU,监视器1上什么也没有显示(它是黑色的,但计算机知道它在那里-绿灯亮并且我所有的窗口都打开了)。使其正常工作的唯一方法是将Monitor 2切换为VGA,将Monitor 1切换为DVI。

如果我进入lspci | grep VGA终端,就会得到以下信息:

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)

跑步xrandr给我:

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

它不是HDMI连接,我不知道为什么会这样。使用GPU,它知道它是DVI。无论如何...

这是xorg.conf(如果我更改它,它只会覆盖它):

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

这是我10-monitors.conf/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

这仍然不允许调试我的CUDA代码。如果运行lsof / dev / nvidia *,我得到:

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

所以我猜Compiz(X服务器?)仍在使用它。如何停止使用它?


1
我认为您正在使用专有的nvidia驱动程序?也许尝试不同的版本可能会有所帮助?(尝试384,387?)另外,您在开发什么CUDA?我没有在14.04上尝试过,但是我在970M nvidia-384上的17.04上使用CUDA8.0.61。(此处没有iGPU)
Robobenklein

1
最好检查的还有intel xserver驱动程序。我将尝试插入最少数量的监视器,并确保不使用Xserver激活nvidia控件。(在X运行时查看Nvidia GUI实用程序,然后查看显示的内容。)同样值得检查的是nvidia-debugdump -l -v -z查看系统如何识别卡。
Robobenklein

Answers:


0

我在双显示器设置方面取得了成功,其中一个连接到我的专用ATI GPU,另一个连接到i7-2600K iGPU。

为了做到这一点,我跑了

xrandr --setprovideroutputsource 1 0

它曾经可以完美地工作,但仍被认为是实验性的,自那时以来,它进行了几次内核升级。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.