gpt4 book ai didi

linux - Debian 中的硬件加速 NVidia 和 Intel 显卡

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:53:18 26 4
gpt4 key购买 nike

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

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

00:02.0 VGA compatible controller [0300]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller [8086:0412] (rev 06)

01:00.0 VGA compatible controller [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 compatible controller [0300]: NVIDIA Corporation GK106 [GeForce GTX 660] [10de:11c0] (rev a1)

01:00.1 Audio device [0403]: NVIDIA Corporation GK106 HDMI Audio Controller [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 的/nvidia/glx 目录中创建一个 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 文件:

Section "ServerLayout"

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

Section "ServerLayout"

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

Section "Files"

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

EndSection

Section "InputDevice"

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

Section "InputDevice"

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

Section "Monitor"

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

Section "Monitor"

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

Section "Device"

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

Section "Device"

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

Section "Screen"

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

Section "Screen"

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 文件通过添加以下几行:

if [ echo $DISPLAY |grep -c ":1" -eq 1 ]; then export 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 显卡的显示器已关闭...有什么建议吗?

最佳答案

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

Section "ServerFlags" Option "AutoAddDevices" "false" Option "AutoEnableDevices" "false" EndSection

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

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

Screen      0  "Screen1" 0 0

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

关于linux - Debian 中的硬件加速 NVidia 和 Intel 显卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25671995/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com