Deep learning: Nvidia graphics card driver installation

guide

This article will introduce how to Ubuntuinstall the graphics card driver on the system.

1. Download the driver

  • Driver download [1]

Open the driver download link above, select the corresponding configuration according to your graphics card model, as shown in the figure below, and click Search.

Driver Download
Driver Download
  • download

After searching, click the download case below to download.

download
download

2. Install dependencies

sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libopenblas-dev liblapack-dev libatlas-base-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev

If the installation fails, first perform pip3the upgrade update, and then repeat the above operations.

sudo apt-get install python3-pip
  • Update upgrade pip3:
sudo pip3 install --upgrade pip

3. Disable system default graphics driver

sudo gedit /etc/modprobe.d/blacklist.conf
 
#
 在文件末尾写入
blacklist nouveau
options nouveau modeset=0
 
#
 保存后手动更新;
sudo update-initramfs -u
 
#
 电脑重启,输入下列指令进行确认,若无输出,则禁用成功:
lsmod | grep nouveau

4. Configure environment variables

  • gedit command to open the configuration file
sudo gedit ~/.bashrc
  • write at the end
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
  • save updates
source ~/.bashrc

5. Uninstall the original driver

sudo apt-get --purge remove nvidia*
sudo apt autoremove

6. Exit the GUI

  • Press and hold ctrl+alt+F1 (1-6 can be) to enter x-server
sudo service lightdm stop
  • If prompted unit lightdm.service not loaded

​ You need to install LightDm:

sudo apt install lightdm

After the installation is complete, an interface pops up, select lightdm, and then sudo service lightdm stop.

7. Install the driver

sudo chmod +x NVIDIA-……………….run*
sudo sh NVIDIA-……………….run* --no-opengl-files --no-x-check --no-nouveau-check 

#
 –no-opengl-files 不安装OpenGL文件
# –no-x-check 安装驱动时不检查X服务,非必需。
# –no-nouveau-check 安装驱动时不检查nouveau,此参数非必需,因为之前已经手动禁用了nouveau。

The options during installation are as follows:

1.The distribution-provided pre-install script failed! Are you sure you want to continue? 

“Yes”

2.Would you like to register the kernel module souces with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later?

“No”

3.Nvidia’s 32-bit compatibility libraries?

“No”

4.Would you like to run the nvidia-xconfigutility to automatically update your x configuration so that the NVIDIA x driver will be used when you restart x? Any pre-existing x confile will be backed up. 

“Yes”
  • Mount the NVIDIA driver:
modprobe nvidia
  • Return to the graphical interface or restart the computer directly
sudo service lightdm start            #回到图形界面
sudo reboot now                       #重启
  • terminal input command
sudo nvidia-smi

References

[1]

Driver download: https://www.nvidia.cn/Download/index.aspx?lang=cn

This article is published by mdnice multi-platform

Guess you like

Origin blog.csdn.net/swindler_ice/article/details/127593369