安装之前先安装驱动。
点开软件与更新
应用更改
之后参考ubuntu18.04上安装CUDA和cuDNN详细过程以及遇到的各种问题_qq_34496399的博客-CSDN博客
如果遇到Existing package manager installation of the driver found. It is strongly recommended that you remove this before continuing的问题,参考Ubuntu下安装CUDA_existing package manager installation of the drive_萌褚的博客-CSDN博客