网站换皮肤了
centos7安装nvidia-docker 在docker中使用GPU
时间:2019-07-01 08:58 浏览:153

摘要

Docker 是领先的容器平台,它现在可用于容器化 GPU 加速的应用程序。这意味着无需进行任何修改即可轻松容器化和隔离加速的应用程序,并将其部署到任何受支持的、可使用 GPU 的基础架构上。 管理和监控加速的数据中心将变得空前容易。

显卡驱动安装

"uname -r": 3.10.0-693.2.2.el7.x86_64
"rpm -qa | grep kernel-devel | grep 3.10.0-693.2.2.el7.x86_64 | wc -l"
"yum install -y kernel-devel-3.10.0-693.2.2.el7.x86_64"
"yum list --showduplicates |grep nvidia | grep driver |grep rhel7 |grep 390.116 | awk -F' ' '{print $1}'":
"yum install -y nvidia-diag-driver-local-repo-rhel7-390.116.x86_64" 
"yum clean all && yum install -y cuda-drivers" 
"yum list --showduplicates |grep cuda |grep rhel7 |grep 9.1.85|grep -v update| awk -F' ' '{print $1}'":
"yum install -y cuda-repo-rhel7-9-1-local.x86_64" 
"yum list --showduplicates | grep cuda | grep rhel7 | grep 9.1 | grep update | awk -F' ' '{print $1}'" 
"yum install -y cuda-repo-rhel7-9-1-local-compiler-update-1.x86_64" 
"yum install -y cuda-repo-rhel7-9-1-local-cublas-performance-update-1.x86_64" 
"yum install -y cuda-repo-rhel7-9-1-local-cublas-performance-update-3.x86_64" 
"yum clean all && yum install -y cuda"

验证显卡驱动

# nvidia-smi

Fri Jun 28 18:21:41 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.116                Driver Version: 390.116                   |
|-------------------------------+----------------------+----------------------+
| 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 V100-SXM2...  On   | 00000000:00:07.0 Off |                    0 |
| N/A   35C    P0    39W / 300W |      0MiB / 16160MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

安装docker

wget https://download.docker.com/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
wget https://nvidia.github.io/nvidia-docker/centos7/x86_64/nvidia-docker.repo -O /etc/yum.repos.d/nvidia-docker.repo
yum install epel-release
yum install -y docker-ce nvidia-docker2
systemctl enable docker
systemctl start docker

验证docker显卡

# nvidia-docker run --rm nvidia/cuda:9.1-devel nvidia-smi

Fri Jun 28 18:21:41 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.116                Driver Version: 390.116                   |
|-------------------------------+----------------------+----------------------+
| 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 V100-SXM2...  On   | 00000000:00:07.0 Off |                    0 |
| N/A   35C    P0    39W / 300W |      0MiB / 16160MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+




如果这篇文章对你有所帮助,可以通过下边的“打赏”功能进行小额的打赏。

本网站部分内容来源于互联网,如有侵犯版权请来信告知,我们将立即处理。


来说两句吧