GPU安裝

我用的服務器是centos版本的通過free -h版本查看配置如下:

[root@GPUNode wangrui]# free -h
              total        used        free      shared  buff/cache   available
Mem:            62G        1.0G         59G         17M        1.6G         60G
Swap:           18G          0B         18G

我是在這個服務器裏面掛載的GPU,所以需要進行環境的配置。

 nvidia-smi#這個命令主要是進行GPU是否安裝成功驗證的

首先先安裝gcc最新版本。

yum -y install gcc-c++

配置elrepo源。

sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
sudo rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

然後執行以下命令。

sudo yum install nvidia-detect
yum install kernel-devel epel-release dkms

通過nvidia-detect查看GPU當前版本。可以看出當前版本是430.26

nvidia-detect -v

Probing for supported NVIDIA devices...
[10de:1e04] NVIDIA Corporation Device 1e04
This device requires the current 430.26 NVIDIA driver kmod-nvidia
[1a03:2000] ASPEED Technology, Inc. ASPEED Graphics Family

然後到https://www.geforce.cn/drivers官網中搜索相對應版本的驅動。填寫信息如下:

參數

然後點擊開始搜索,然後找到430.26版本的進行下載。

wget -r -np -nd https://us.download.nvidia.com/XFree86/Linux-x86_64/430.26/NVIDIA-Linux-x86_64-430.26.run
chmod +x NVIDIA-Linux-x86_64-430.26.run
sh NVIDIA-Linux-x86_64-430.26.run 
lsmod | grep nouveau

nouveau和GPU會出現衝突會使得sh NVIDIA**.run的時候出現報錯,然後進行如下操作。

vim /etc/default/grub

在文件中加入:

GRUB_CMDLINE_LINUX末尾加入nouveau.modeset=0 

然後執行:

grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
sh NVIDIA-Linux-x86_64-430.26.run

然後進入圖形界面,按照指示進行操作即可。

nvidia-smi
顯示如下:
Thu Jun 13 09:45:13 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.26       Driver Version: 430.26       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce RTX 208...  Off  | 00000000:D8:00.0 Off |                  N/A |
| 34%   42C    P0     1W / 250W |      0MiB / 11019MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章