1.删除旧cuca,旧显卡驱动
sudo apt-get --purge remove "*cublas*" "*cufft*" "*curand*" "*cusolver*" "*cusparse*" "*npp*" "*nvjpeg*" "cuda*" "nsight*"
sudo apt-get --purge remove "*nvidia*"
2.安装新驱动
先查看推荐的驱动版本
ubuntu-drivers devices
安装显卡驱动
sudo apt-get install nvidia-driver-535
重启
查看英伟达官网的表格,安装最新的cuda版本
CUDA 12.2 Release Notes — cuda-toolkit-release-notes 12.2 documentation