根据https://blog.csdn.net/qq_27386899/article/details/104113553,要先卸载之前安装的nvidia的东西,否则会出错:
sudo apt purge nvidia-*
然后看这篇文章:https://flywine.blog.csdn.net/article/details/81879514
安装完之后cuda就能跑了,但是重启之后deepin好像会自己激活nouveau???
查看/etc/modprobe.d/nvidia-installer-disable-nouveau.conf
,发现cuda安装器已经禁用nouveau了:
# generated by nvidia-installer
blacklist nouveau
options nouveau modeset=0
根据https://blog.csdn.net/tqcai666/article/details/89739724,其实还需要更新一下initramfs:
sudo update-initramfs -ut
然后重启一下就好了。