Centos Nvidia driver installation, Cuda, Cudnn, TF2.0

Centos Nvidia driver installation, Cuda, Cudnn, TF2.0

1, the drive installation Nvidia

On my server previously installed the Nvidia driver, the operation is carried out based on the original, equivalent to update the driver.

If the install from scratch need to refer to this tutorial: https://blog.csdn.net/xueshengke/article/details/78134991


If you are updating, you need to uninstall the previous version.

sudo ./NVIDIA-Linux-x86-310.19.run --uninstall

First need to download the corresponding version number of drive:
https://www.geforce.cn/drivers
after the above website to download a good driver, proceeding

Then send documents on a remote server, you can use Xftp sent to the specified directory (you can easily specify).

Switch to another directory by entering the following drivers installed:

chmod +x NVIDIA-Linux-x86_64-440.31.run
./NVIDIA-Linux-x86_64-440.31.run

Then waiting to read the progress.

I encountered the following error during installation:

unable to find the kernel source tree for current running kernel

This error occurs because: Linux Kernel version currently running and is inconsistent with the kernel-devel kernel-headers version. We need to make it consistent with the update.
This error can refer to: https://blog.csdn.net/haixwang/article/details/90408538

The above mentioned website blog could not find the kernel-devel and kernel-headers version. You can find from the following website: http://rpm.pbone.net/

Solve this problem after the installation can be carried out smoothly.

About installation options:

dkms install the best option yes
32-bit compatibility install the best option yes
the X-ORG-better not safe, choose no, some computers may result in a black screen login screen

After installation input command to verify: nvidia-smi

2, installation Cuda

安装Cuda推荐使用conda进行安装。
输入如下指令即可进行安装:

conda install cudatoolkit=10.0
conda install cudnn=7.6

注意:在tensorflow2.0中暂时不支持(cuda10.1--2019.11.6测试)。所以需要安装cuda10.0。
若使用cuda10.1则会报错。

Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.

3、安装TF2.0

使用conda安装CPU版本。

conda install tensorflow=2.0

TF2.0 GPU版本使用conda安装会报错,需要使用pip命令来安装。

pip install tensorflow-gpu

安装完成后,需要进行测试。输入如下指令:

python

先输入以上指令进入python解释器,在输入下面的指令。

from __future__ import absolute_import, division, print_function, unicode_literals

import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))

若是结果等于0,则代表没安装好GPU版本。

Guess you like

Origin www.cnblogs.com/lian1995/p/11806449.html