/usr/lib/xorg/xorg
是桌面(作为远程服务器,一般用不上图形化桌面),可以通过两种方法避免它所占用的显存:
方法一:注释10-nvidia.conf文件内容
- 打开文件
/usr/share/X11/xorg.conf.d/10-nvidia.conf
sudo vim /usr/share/X11/xorg.conf.d/10-nvidia.conf
- 用
#
注释文件内所有内容 - 重启
X11
服务
ref: 1. Prevent /usr/lib/xorg/Xorg from using GPU Memory in Ubuntu 20.04 Serversudo systemctl restart display-manager
方法二:切换xorg到集显
- 查看集显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 - 编辑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
- 重启机器
reboot