dpkg -l | grep nvidia
sudo apt-get purge nvidia*
清理链接
sudo apt autoremove
查询可用驱动
ubuntu-drivers devices
ubuntu-drivers devices
WARNING:root:_pkg_get_support nvidia-driver-390: package has invalid Support Legacyheader, cannot determine support level
WARNING:root:_pkg_get_support nvidia-driver-510-server: package has invalid Support PBheader, cannot determine support level
WARNING:root:_pkg_get_support nvidia-driver-510: package has invalid Support PBheader, cannot determine support level
== /sys/devices/pci0000:00/0000:00:02.0/0000:02:00.0/0000:03:10.0/0000:05:00.0 ==
modalias : pci:v000010DEd00001B80sv00001043sd0000859Bbc03sc00i00
vendor : NVIDIA Corporation
model : GP104 [GeForce GTX 1080]
driver : nvidia-driver-390 - third-party non-free
driver : nvidia-driver-470 - distro non-free recommended
driver : nvidia-driver-510-server - distro non-free
driver : nvidia-driver-418-server - distro non-free
driver : nvidia-driver-510 - third-party non-free
driver : nvidia-driver-470-server - distro non-free
driver : nvidia-driver-450-server - distro non-free
driver : xserver-xorg-video-nouveau - distro free builtin
自动安装推荐的驱动
sudo ubuntu-drivers autoinstall
安装完成后 reboot
去 NVIDIA官网 选择对应版本 cuda11.3
会生成一个下载与安装的命令
wget https://developer.download.nvidia.com/compute/cuda/11.3.1/local_installers/cuda_11.3.1_465.19.01_linux.run
sudo sh cuda_11.3.1_465.19.01_linux.run
下载完后 按上诉命令执行
自定义一些选项,建议其他都保持默认,samplecode 安装到自己喜欢的位置
等待结束
export CUDA_HOME=/usr/local/cuda-11.3
export PATH=$PATH:$CUDA_HOME/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda-11.3/lib64
haolin@MG6:~$ source .bashrc
haolin@MG6:~$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_May__3_19:15:13_PDT_2021
Cuda compilation tools, release 11.3, V11.3.109
Build cuda_11.3.r11.3/compiler.29920130_0
cuda 完成安装。
sudo dpkg -i libcudnn8_8.2.1.32-1+cuda11.3_amd64.deb
sudo dpkg -i libcudnn8_8.2.1.32-1+cuda11.3_amd64.deb
sudo dpkg -i libcudnn8-samples_8.2.1.32-1+cuda11.3_amd64.deb
安装后代码 在/usr/src/cudnn_samples_v8 下
cp -r /usr/src/cudnn_samples_v8 ~/AI/
sudo apt-get install libfreeimage3 libfreeimage-dev
rootcause: 存在多个驱动。 清除驱动,同时清除对应的链接后,安装正常。
/bin/ld: cannot find -lglut
collect2: error: ld returned 1 exit status
sudo apt-get install freeglut3 freeglut3-dev
VulkanBaseApp.cpp:30:10: fatal error: GLFW/glfw3.h: No such file or directory
30 | #include <GLFW/glfw3.h>
sudo apt-get install libglfw3-dev
关注