/usr/lib/xorg/xorg是桌面(作为远程服务器,一般用不上图形化桌面),可以通过两种方法避免它所占用的显存:

方法一:注释10-nvidia.conf文件内容

  1. 打开文件/usr/share/X11/xorg.conf.d/10-nvidia.conf
    sudo vim /usr/share/X11/xorg.conf.d/10-nvidia.conf
    
  2. #注释文件内所有内容
  3. 重启X11服务
    sudo systemctl restart display-manager
    
    ref: 1. Prevent /usr/lib/xorg/Xorg from using GPU Memory in Ubuntu 20.04 Server

方法二:切换xorg到集显

  1. 查看集显BUS ID(步骤2中要用到)
    lspci | grep VGA
    
    如果编号是00:02.0,则BusId是 PCI:0:2:0;如果编号是04:00.0,则BusId是 PCI:4:0:0。类比得到自己的BUS ID.
    ref:1. Ubuntu桌面占用独显显存问题;2. BusID de la carte graphique
  2. 编辑xorg文件(如果没有则会自动添加)
    sudo vim /etc/X11/xorg.conf 
    
    插入以下内容:
    Section "Device"
    	Identifier      "intel"
        Driver          "intel"
        BusId           "PCI:0:2:0"
    EndSection
    
    Section "Screen"
    	Identifier      "intel"
        Device          "intel"
    EndSection
    
  3. 重启机器
    reboot
    
Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐