系统 Ubuntu 16.04
1.禁用系统默认显卡驱动
(1). 打开黑名单
vi /etc/modprobe.d/blacklist.conf
(2).将下列代码填入文件末尾:
# for nvidia display device install
blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist rivatv
blacklist nvidiafb
(3).保存,然后更新initramfs:
sudo update-initramfs -u
(4). 重启电脑
sudo reboot
(5).查看是否禁用成功,无输出则禁用成功
lsmod | grep nouveau
2.关闭X server
sudo service lightdm stop
3.关闭相关进程
ERROR: An NVIDIA kernel module 'nvidia' appears to already be loaded in your kernel. This may be because it is in use (for example, by an X server, a CUDA program, or the NVIDIA Persistence Daemon), but this may also happen if your kernel was configured without support for module unloading. Please be sure to exit any programs that may be using the GPU(s) before attempting to upgrade your driver. If no GPU-based programs are running, you know that your kernel supports module unloading, and you still receive this message, then an error may have occured that has corrupted an NVIDIA kernel module's usage count, for which the simplest remedy is to reboot your computer.
sudo lsof /dev/nvidia*
Then, kill the processes by the corresponding PID with kill -9 PID.