-
我们要用显卡坞上的视频接口
HDMI
或者DP
来输出(显卡端口输出),因为直接通过显卡端口输出可以节省显卡与cpu
的交流, -
首先找到你的显卡
PCI
地址:lspci
-
找到这一行:
03:00.0 VGA compatible controller: NVIDIA Corporation TU104 [GeForce RTX 2070 SUPER] (rev a1)
-
03
就是地址,十六进制表示,不过03的十进制还是03。 -
创建文件夹:
sudo mkdir /etc/X11/xorg.conf.d/
-
然后创建文件:
sudo vim /etc/X11/xorg.conf.d/nvidia.conf
-
在文件中粘贴,保存,退出:
Section "Device" Identifier "Videocard0" BusID "PCI:03:0:0" # 把03换成你的地址 Driver "nvidia" VendorName "NVIDIA Corporation" Option "AllowEmptyInitialConfiguration" Option "AllowExternalGpus" EndSection
-
最后,修改
10-nvidia.conf
文件sudo vim /usr/share/X11/xorg.conf.d/10-nvidia.conf
-
原本是这样:
# This xorg.conf.d configuration snippet configures the X server to # automatically load the nvidia X driver when it detects a device driven by the # nvidia-drm.ko kernel module. Please note that this only works on Linux kernels # version 3.9 or higher with CONFIG_DRM enabled, and only if the nvidia-drm.ko # kernel module is loaded before the X server is started. Section "OutputClass" Identifier "nvidia" MatchDriver "nvidia-drm" Driver "nvidia" EndSection
-
加入
Option "AllowExternalGpus" "true"
:# This xorg.conf.d configuration snippet configures the X server to # automatically load the nvidia X driver when it detects a device driven by the # nvidia-drm.ko kernel module. Please note that this only works on Linux kernels # version 3.9 or higher with CONFIG_DRM enabled, and only if the nvidia-drm.ko # kernel module is loaded before the X server is started. Section "OutputClass" Identifier "nvidia" MatchDriver "nvidia-drm" Driver "nvidia" Option "AllowExternalGpus" "true" EndSection
-
按
esc
退出,输入:wq
退出; -
sudo reboot
; -
等开机画面过后,你就可以看到你的外接屏幕上有画面了。
评论区