1.基于宿主机Rhel7安装显卡驱动:
ERROR:Unable to find the kernel source tree for the currently running kernel.可能需要修改对应的kernel-devel,手动下载对应版本,rpm一下。
2.安装Nvidia-container-toolkit:
rpm -ivh libseccomp-2.3.1-4.el7.x86_64.rpm
rpm -ivh libnvidia-container1-1.4.0-1.x86_64.rpm
rpm -ivh libnvidia-container-tools-1.4.0-1.x86_64.rpm
rpm -ivh nvidia-container-toolkit-1.5.1-2.x86_64.rpm
systemctl restart docker
systemctl status docker
3.加载镜像
docker load --input *****.tar
4.创建容器
docker run --gpus all --name yourname -v $PWD:/yourpath -p 49100:49101 -it 镜像名 /bin/bash