设备:NVIDIA Corporation GV100GL [Tesla V100 PCIe 16GB] (rev a1)
# Ucloud Ubuntu 18.04 GPU 环境 Driver,Cuda,Docker,Nvidia-docker 安装记录############################################################## 部分1 参考/gpu/operation/ubuntu18_cuda# 检查GPU设备识别sudo lspci | grep NVIDIA# 屏蔽开源驱动sudo vim /etc/modprobe.d/blacklist-nouveau.conf# 添加如下内容blacklist nouveaublacklist lbm-nouveauoptions nouveau modeset=0alias nouveau offalias lbm-nouveau off# 更新并重启sudo update-initramfs -usudo rebootsudo apt-get install build-essential pkg-config# 安装内核wget -/linux-headers-4.15.1-041501-generic_4.15.1-041501.02031831_amd64.debwget -/linux-headers-4.15.1-041501_4.15.1-041501.02031831_all.debwget -/linux-image-4.15.1-041501-generic_4.15.1-041501.02031831_amd64.debsudo dpkg -i *.debsudo reboot# 查看uname -r # 安装驱动/Download/index.aspx?lang=en-us # 搜合适的,我选的是下面的版本bash NVIDIA-Linux-x86_64-440.118.02.run # 查看驱动状态sudo nvidia-smi# 安装cuda库,这里装的是10.2wget http://developer./compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.runsudo sh cuda_10.2.89_440.33.01_linux.run############################################################## 部分2 装docker 参考官网 /engine/install/ubuntu/sudo apt-get updatesudo apt-get install \apt-transport-https \ca-certificates \curl \gnupg \lsb-releasecurl -fsSL /linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpgecho \"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] /linux/ubuntu \$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/nullsudo apt-get updatesudo apt-get install docker-ce docker-ce-cli containerd.io# 测试sudo docker run hello-world# 测试GPUsudo docker run -it --rm --gpus all ubuntu nvidia-smi################################################################### 部分3 安装运行时辅助 个人感觉似乎也没啥用 这部分或许可以省略直接到下一步 参考/BigData_Mining/article/details/104991349vim nvidia-container-runtime-script.sh # 添加内容sudo curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | \sudo apt-key add -distribution=$(. /etc/os-release;echo $ID$VERSION_ID)sudo curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | \sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.listsudo apt-get update# 执行脚本sh nvidia-container-runtime-script.shapt-get install nvidia-container-runtime# 查看which nvidia-container-runtime-hook############################################################## 部分4 安装 nvidia-docker 参考/datacenter/cloud-native/container-toolkit/install-guide.html#dockercurl | sh \&& sudo systemctl --now enable dockerdistribution=$(. /etc/os-release;echo $ID$VERSION_ID) \&& curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \&& curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.listsudo apt-get updatesudo apt-get install -y nvidia-docker2sudo systemctl restart docker# 测试sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
效果图