侧边栏壁纸
博主头像
Excalibur博主等级

真实自有万钧之力。

  • 累计撰写 25 篇文章
  • 累计创建 14 个标签
  • 累计收到 2 条评论

VMware中Ubuntu20.04下Nvidia显卡连接外屏显示教程

Excalibur
2020-12-02 / 0 评论 / 0 点赞 / 1,304 阅读 / 1,627 字
温馨提示:
本文最后更新于 2022-04-07,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。
  • 我们要用显卡坞上的视频接口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

  • 等开机画面过后,你就可以看到你的外接屏幕上有画面了。

0

评论区