cd /usr/bin
./nvidia-uninstall
sudo apt-get --purge remove "*nvidia*"
sudo apt autoremove
# To remove CUDA Toolkit:
sudo apt-get --purge remove "*cublas*" "cuda*"
在/etc/modprobe.d/blacklist.conf
末尾添加
blacklist nouveau
options nouveau modeset=0
sudo update-initramfs -u
sudo rmmod nouveau
输入指令后重启系统(一定要重启),确保到位
lsmod | grep nouveau
sudo service lightdm stop
sudo apt install build-essential
# 该命令将安装一堆新包,包括gcc,g ++和make。
sudo chmod a+x NVIDIA-Linux-x86_64-396.18.run
sudo ./NVIDIA-Linux-x86_64-396.18.run -no-x-check -no-nouveau-check -no-opengl-files
#The distribution-provided pre-install script failed! Are you sure you want to continue?
#选择 yes 继续。
#Would you like to register the kernel module souces with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later?
#选择 No 继续。
#Install NVIDIA's 32-bit compatibility libraries?
#选择 No 继续。
#Would you like to run the nvidia-xconfigutility to automatically update your x configuration so that the NVIDIA x driver will be used when you restart x? Any pre-existing x confile will be backed up.
#选择 Yes 继续