赞
踩
GPU-英伟达驱动 , cuda,cudnn 的安装
首先看gpu的版本
直接安装gpu显卡可以支持的最高版本的驱动。高版本的驱动可以兼容低版本的cuda.
查看显卡版本 参考链接
https://blog.csdn.net/distant1219/article/details/118370133
lspci -vnn | grep VGA
lspci | grep -i nvidia
根据图中红框里的代码(四位数字),可以在搜索引擎上查询一下,即可得知显卡型号。
参考网址http://pci-ids.ucw.cz/mods/PC/10de?action=help?help=pci
运行ubuntu-drivers devices
如果不行,先执行
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
选择后面带着recommond 的那个版本的驱动。
**特别说明:**如果你后面还要装cuda,那么这一步就不是必须的,因为cuda安装包里是有驱动的。我原来没太注意,总是会多走这一步。不过,不论你是用这里安装driver,还是采用cuda中的driver,后面那个Nouveau都必须卸载掉,不然总会有些莫名其妙的问题。
驱动下载链接
https://www.nvidia.com/Download/index.aspx?lang=en-us
sudo sh NVIDIA-Linux-x86_64-440.100.run
卸载Nouveau
#---open a terminal---
sudo apt-get remove nvidia*
sudo apt autoremove
sudo apt-get install dkms build-essential linux-headers-generic
sudo vim /etc/modprobe.d/blacklist.conf
#---save the following info into file blacklist.conf---
blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off
#---end of the info saved----
#---go back to the terminal---
echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
sudo update-initramfs -u
reboot
————————————————
参考链接:https://blog.csdn.net/tanmx219/java/article/details/86553485
可能存在的问题
The distribution-provided pre-install script failed! Are you sure you want
to continue?
Continue installation Abort installation
----> Continue installation
Would you like to register the kernel module sources with DKMS? This will
allow DKMS to automatically build a new module, if you install a different
kernel later.
Yes No
---->No
The CC version check failed:
The kernel was built with gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1),
but the current compiler version is cc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0.
This may lead to subtle problems; if you are not certain whether the
mismatched compiler will be compatible with your kernel, you may wish to
abort installation, set the CC environment variable to the name of the
compiler used to compile your kernel, and restart installation.
Ignore CC version check Abort installation
----> select ignore
WARNING: Ignoring CC version mismatch:
The kernel was built with gcc version 7.4.0 (Ubuntu
7.4.0-1ubuntu1~18.04.1), but the current compiler version is cc
(Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0.
OK
----> OK
Install NVIDIA's 32-bit compatibility libraries?
Yes No
----> No
An incomplete installation of libglvnd was found. All of the essential
libglvnd libraries are present, but one or more optional components are
missing. Do you want to install a full copy of libglvnd? This will overwrite
any existing libglvnd libraries.
Don't install Install and overw Abort installation.
---->Install and overw
Would you like to run the nvidia-xconfig utility to automatically update
your X configuration file so that the NVIDIA X driver will be used when you
restart X? Any pre-existing X configuration file will be backed up.
Yes No
---->Yes
Your X configuration file has been successfully updated. Installation of
the NVIDIA Accelerated Graphics Driver for Linux-x86_64 (version: 440.100)
is now complete.
OK
----> OK
检查安装成功与否
nvidia-smi
sudo dpkg --list | grep nvidia-*
第一步,打开终端,先用nvidia-smi查看一下,发现如下报错:
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver.
Make sure that the latest NVIDIA driver is installed and running.
第二步,使用nvcc -V检查驱动和cuda。
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
发现驱动是存在的,于是进行下一步
第三步,查看已安装驱动的版本信息
ls /usr/src | grep nvidia
比如我的驱动版本是:nvidia-450.57
第四步,依次输入以下命令
sudo apt-get install dkms
sudo dkms install -m nvidia -v 450.57
等待安装完成后,再次输入nvidia-smi
sudo chmod a+x cuda_10.0.130_410.48_linux.run
sudo ./cuda_10.0.130_410.48_linux.run --no-opengl-libs
问题1:
出现报错
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。