1.首先查看机器是否具有GPU
[javis@node5 rpm_resource]$ lspci | grep -i nvidia06:00.0 3D controller: NVIDIA Corporation GP100GL (rev a1)81:00.0 3D controller: NVIDIA Corporation GP100GL (rev a1)2.在官网下载对应的驱动http://www.nvidia.cn/Download/index.aspx?lang=cn
然后跳转到下载页面,下载 nvidia-diag-driver-local-repo-rhel7-390.30-1.0-1.x86_64.rpm
(PS:注意下面红色的框内是安装步骤,安装后可以使用nvidia-smi命令)
3.安装步骤建议使用官方的
Once you accept the download please follow the steps listed below i) `rpm -i nvidia-diag-driver-local-repo-rhel7-390.30-1.0-1.x86_64.rpm' ii) `yum clean all`iii) `yum install cuda-drivers` iv) `reboot`但这里安装的时候可能会遇到
Error: Package: 1:nvidia-kmod-390.30-2.el7.x86_64 (nvidia-diag-driver-local-390.30)Requires: dkms下载安装dkms-2.2.0.3-31.1.noarch.rpm即可解决问题
sudo rpm -vih dkms-2.2.0.3-31.1.noarch.rpm4.测试是否安装成功
[javis@node5 cuda_example]$ nvidia-smiThu Mar 1 09:03:20 2018 +-----------------------------------------------------------------------------+| NVIDIA-SMI 387.26 Driver Version: 387.26 ||-------------------------------+----------------------+----------------------+| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC || Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. ||===============================+======================+======================|| 0 Tesla P100-PCIE... Off | 00000000:06:00.0 Off | 0 || N/A 28C P0 29W / 250W | 0MiB / 16276MiB | 0% Default |+-------------------------------+----------------------+----------------------+| 1 Tesla P100-PCIE... Off | 00000000:81:00.0 Off | 0 || N/A 26C P0 27W / 250W | 0MiB / 16276MiB | 0% Default |+-------------------------------+----------------------+----------------------++-----------------------------------------------------------------------------+| Processes: GPU Memory || GPU PID Type Process name Usage ||=============================================================================|| No running processes found |+-----------------------------------------------------------------------------+PS:安装cuda的时候会动安装nvidia驱动,安装log信息
Installing the NVIDIA display driver...Installing the CUDA Toolkit in /usr/local/cuda-9.1 ...cudann安装:
解压cudann.tgz包后后运行:sudo cp cuda/include/cudnn.h /usr/local/cuda/includesudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |