【问题标题】:Hardware Accelerated NVidia and Intel Graphics Together in DebianDebian 中的硬件加速 NVidia 和 Intel 显卡一起使用
【发布时间】:2026-01-14 21:00:02
【问题描述】:

我想使用两个 xserver,每个都在单独的显卡上运行,实际上我正在使用两个显示器,在我的计算机上安装了两个不同的显卡,像这样:

root@ziomario-Z87-HD3:/home/ziomario# lspci -nn | grep VGA

00:02.0 VGA 兼容控制器 [0300]:英特尔公司至强 E3-1200 v3/4th Gen Core Processor 集成图形控制器 [8086:0412](修订版 06)

01:00.0 VGA 兼容控制器 [0300]:NVIDIA Corporation GK106 [GeForce GTX 660] [10de:11c0] (rev a1)

root@ziomario-Z87-HD3:/home/ziomario# lspci -nn | grep NVIDIA

01:00.0 VGA 兼容控制器 [0300]:NVIDIA Corporation GK106 [GeForce GTX 660] [10de:11c0] (rev a1)

01:00.1 音频设备 [0403]:NVIDIA Corporation GK106 HDMI 音频 控制器 [10de:0e0b] (rev a1)

我正在阅读这个article

而且我已经更改了一些命令,因为他说要做的事情与我的情况之间存在差异。这就是我所做的:

使用此命令以 root 用户身份安装 NVidia 驱动程序:

./NVIDIA-Linux-x86_64-340.32.run –accept-license –no-backup –no-x-check –no-questions –ui=none –no-x-check –no-distro-scripts –utility-prefix=/nvidia –installer-prefix=/nvidia –opengl-prefix=/nvidia –opengl-libdir=glx

在 /nvidia/glx 目录中为 NVidia 创建了一个 libglx.so 链接:

ln -s /usr/lib/xorg/modules/extensions/libglx.so.295.59 libglx.so

以 root 身份创建文件夹 /etc/ld.conf.d(它以前不存在),其中包含文件:/etc/ld.conf.d/nvidia,其中两行指向新的库目录:

/nvidia/lib
/nvidia/glx

以 root 身份运行此命令以激活上述路径。

ldconfig

使用命令创建文件 /etc/X11/xorg.conf

nvidia-xconfig

使用 ModulePath 选项将 nvidia xserver 定向到正确的 Glx。将此添加到现有文件部分的 /etc/X11/xorg.conf 中,如下所示:

这是我的 xorg.conf 文件:

“服务器布局”部分

Identifier     "Layout0"
Screen      0  "Screen0"
InputDevice    "Keyboard0" "CoreKeyboard"
InputDevice    "Mouse0" "CorePointer" EndSection

“服务器布局”部分

Identifier     "Layout1"
Screen      0  "Screen1" 0 0
Option         "Xinerama" "0" EndSection

“文件”部分

modulepath "/nvidia/glx,/nvidia/lib,/usr/lib/xorg/modules" 

结束部分

“输入设备”部分

# generated from default
Identifier     "Mouse0"
Driver         "mouse"
Option         "Protocol" "auto"
Option         "Device" "/dev/psaux"
Option         "Emulate3Buttons" "no"
Option         "ZAxisMapping" "4 5" EndSection

“输入设备”部分

# generated from default
Identifier     "Keyboard0"
Driver         "kbd" EndSection

“监控”部分

Identifier     "Monitor0"
VendorName     "Unknown"
ModelName      "Unknown"
HorizSync       28.0 - 33.0
VertRefresh     43.0 - 72.0
Option         "DPMS" EndSection

“监控”部分

Identifier     "Monitor1"
VendorName     "Unknown"
Option         "DPMS" EndSection

“设备”部分

Identifier     "Device0"
Driver         "nvidia"
VendorName     "NVIDIA Corporation" EndSection

“设备”部分

Identifier     "Device1"
Driver         "intel"
BusID          "PCI:0:2:0"
Option         "AccelMethod" "uxa" EndSection

“屏幕”部分

Identifier     "Screen0"
Device         "Device0"
Monitor        "Monitor0"
DefaultDepth    24
SubSection     "Display"
    Depth       24
EndSubSection EndSection

“屏幕”部分

Identifier     "Screen1"
Device         "Device1"
Monitor        "Monitor1"
DefaultDepth    24
SubSection     "Display"
Depth       24
EndSubSection EndSection

在文件中配置用户 LD_LIBRARY_PATH 环境(这可以在 /etc/profile 和 /etc/bash.bashrc 配置文件中通用设置): ~/.profile ~/.bashrc 和 ~/.xsession 文件通过添加以下几行:

如果 [echo $DISPLAY |grep -c ":1" -eq 1];然后 导出 LD_LIBRARY_PATH=/nvidia/glx

fi

使用 Glx 重新安装了 xorg 包,以便更正以前安装 NVidia 造成的损坏:

apt-get --reinstall install glx-alternative-mesa xserver-xorg-core libgl1-mesa-glx libgl1-mesa-dri

重启Gdm3

/etc/init.d/gdm3 restart

它没有工作。与 NVIDIA 显卡相连的显示器工作正常,但另一个显示器,连接在哪里 INTEL 显卡关闭...有什么建议吗?

【问题讨论】:

    标签: linux debian intel nvidia multiset


    【解决方案1】:

    使用鼠标指针时出现空白屏幕还是空白屏幕?我有几乎相同的硬件并使用 2 个 xorg 文件,每个座位一个,lightdm 作为桌面管理器。当我在seat1(intel)上启用选项时出现问题

    “服务器标志”部分 选项“自动添加设备”“假” 选项“AutoEnableDevices”“假” 结束部分

    我需要这些选项来限制各自座位上的鼠标和键盘。

    并在你的 xorg.conf 中检查一下:

    Screen      0  "Screen1" 0 0
    

    你确定第一个“0”没问题吗?

    【讨论】:

      【解决方案2】:

      编辑:我在这里发布了完整的操作指南HOWTO: Intel and Nvidia accelerated on a 2 seat machine

      我在 nvidia 和 intel 上使用带有 lightdm 的 multiseat(gdm3 没有给我很多选择),我的 intel 仍然没有加速(但我认为情况并非如此,因为我遇到了同样的问题,这是由错误的配置引起的) .

      这是我的配置:

      /etc/lightdm/lightdm.conf

      [LightDM]
      [SeatDefaults]
      xserver-allow-tcp=false
      greeter-session=lightdm-greeter
      greeter-hide-users=true
      session-wrapper=/etc/X11/Xsession
      autologin-user=john
      [XDMCPServer]
      [VNCServer]
      [Seat:0]                          ###nvidia
      xserver-command=/usr/bin/X :0
      xserver-config=xorg_seat0.conf
      autologin-user=john
      [Seat:1]                          ###intel
      xserver-command=/usr/bin/X :1 -sharevts
      xserver-config=xorg_seat1.conf
      autologin-user=desk
      

      /etc/X11/xorg_seat0.conf

      Section "ServerFlags"
          Option "AllowMouseOpenFail" "on"
          Option "AllowEmptyInput" "on"
          Option "ZapWarning" "on"
          Option "HandleSpecialKeys" "off"
          Option "DRI2" "on"
          Option "Xinerama" "off"
      EndSection
      
      Section "InputClass"
          Identifier    "Disable cable keyboard"
          MatchProduct  "AT Translated Set 2 keyboard"
          Option        "Ignore" "on"
      EndSection
      
      Section "InputClass"
          Identifier    "Disable cable mouse"
          MatchProduct  "Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)"
          Option        "Ignore" "on"
      EndSection
      
      Section "ServerLayout"
          Identifier     "Seat0"
          Screen      0  "Screen0" 0 0
          InputDevice    "Keyboard0" "CoreKeyboard"
          InputDevice    "Mouse0" "CorePointer"
          Option         "Xinerama" "0"
      EndSection
      
      Section "Files"
      EndSection
      
      Section "InputDevice"
          Identifier     "Mouse0"
          Driver         "mouse"
          Option         "Protocol" "auto"
          Option         "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-mouse"
          Option         "Emulate3Buttons" "no"
          Option         "ZAxisMapping" "4 5"
          Option         "GrabDevice" "on"
      EndSection
      
      Section "InputDevice"
          Identifier     "Keyboard0"
          Driver         "kbd"
          Option         "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-kbd"
          Option         "GrabDevice" "on"
      EndSection
      
      Section "Monitor"
          Identifier     "Monitor0"
          VendorName     "LG"
          ModelName      "LG Electronics LG TV"
          HorizSync       30.0 - 83.0
          VertRefresh     58.0 - 62.0
          Option         "DPMS"
      EndSection
      
      Section "Device"
          Identifier     "Device0"
          Driver         "nvidia"
          VendorName     "NVIDIA Corporation"
          BoardName      "GeForce GTS 250"
          Option         "NoLogo" "1"
          BusId          "PCI:1:0:0"
          Option         "ProbeAllGpus" "false"
      EndSection
      
      Section "Screen"
          Identifier     "Screen0"
          Device         "Device0"
          Monitor        "Monitor0"
          DefaultDepth    24
          Option         "Stereo" "0"
          Option         "nvidiaXineramaInfoOrder" "DFP-1"
          Option         "metamodes" "nvidia-auto-select +0+0"
          SubSection     "Display"
              Depth       24
          EndSubSection
      EndSection
      

      /etc/X11/xorg_seat1.conf

      Section "ServerFlags"
          Option "AllowMouseOpenFail" "on"
          Option "AllowEmptyInput" "on"
          Option "ZapWarning" "on"
          Option "HandleSpecialKeys" "off"
          Option "DRI2" "on"
          Option "Xinerama" "off"
      EndSection
      
      Section "InputClass"
          Identifier   "Disable Logitech wireless keyboard and mouse"
          MatchProduct "Logitech USB Receiver"
          Option       "Ignore" "on"
      EndSection
      
      Section "ServerLayout"
          Identifier     "Seat1"
          Screen      0  "Screen1" 0 0
          InputDevice    "Keyboard1" "CoreKeyboard"
          InputDevice    "Mouse1" "CorePointer"
      EndSection
      
      Section "InputDevice"
          Identifier     "Mouse1"
          Driver         "mouse"
          Option         "Protocol" "auto"
          Option         "Device" "/dev/input/by-id/usb-Microsoft_Microsoft_3-Button_Mouse_with_IntelliEye_TM_-event-mouse"
          Option         "Emulate3Buttons" "no"
          Option         "ZAxisMapping" "4 5"
          Option         "GrabDevice" "on"
      EndSection
      
      Section "InputDevice"
          Identifier     "Keyboard1"
          Driver         "kbd"
          Option         "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
          Option         "GrabDevice" "on"
      EndSection
      
      Section "Monitor"
          Identifier     "Monitor1"
          VendorName     "LG"
          ModelName      "LG Electronics W2042"
          HorizSync       30.0 - 83.0
          VertRefresh     56.0 - 75.0
          Option         "DPMS"
      EndSection
      
      Section "Device"
          Identifier     "Device1"
          Driver         "intel"
          VendorName     "Intel Corporation"
          BoardName      "Intel 82G31"
          BusID          "PCI:0:2:0"
          Screen         0
      EndSection
      
      Section "Screen"
          Identifier     "Screen1"
          Device         "Device1"
          Monitor        "Monitor1"
          DefaultDepth    24
          Option         "Stereo" "0"
          SubSection     "Display"
              Depth       24
          Modes       "1680x1050"
          EndSubSection
      EndSection
      

      要查找 /dev/input/by-path/ 使用

      ls -la /dev/input/by-path
      

      要查找 /dev/input/by-id/ 使用

      ls -la /dev/input/by-id
      

      (最好使用 /dev/input/by-id/... 除非您有 ps2 键盘或鼠标。然后使用 /dev/input/by-path...)

      要查找键盘和鼠标的 MatchProduct 值,请在“活动”xsession 上使用 xinput,而不是在裸控制台上。

      sudo apt-get install xinput
      xinput
      

      接下来的几个小时我会按照你的描述尝试加速我的英特尔卡,所以我会提供更多信息:)

      【讨论】:

        【解决方案3】:

        这可能是一个http://unix.stackexchange.com 问题...

        根据您要完成的任务,运行 2 个 x-server 可以解决使用一个 GPU 驱动一台显示器并使用另一个 GPU 驱动另一台显示器的问题,但也会产生另一组问题:您将无法在一个和另一个监视器之间移动应用程序等,...

        两张卡都需要一个公共帧缓冲区来驱动一个公共桌面以让某些应用程序运行一张卡或另一张卡,这就是bumblebee project 正在为您做的事情。 NVidia 专有驱动程序和 bumblebee 二进制文件都位于安装 xorg.edgers PPA 中。

        由于 xorg.edgers 小组要求不要在没有链接到他们的页面的情况下直接给出安装说明,这是我现在能做的最好的...

        如果您不知道 PPA 是什么,或者在阅读了他们的页面后需要一些有关向前和向后滚动驱动程序版本的指导,请在下方发表评论。

        公平警告:我是一名 Ubuntu 杂种用户,而不是纯种 Debian 用户,但他们已经足够接近,以至于他们的解决方案可能仍会杂交。 ;-)

        【讨论】:

          最近更新 更多