sudo apt install docker.io
sudo groupadd docker
sudo usermod -aG docker ${USER}
sudo systemctl restart docker
docker ps
如果当前用户执行无报错, 则表示用户已经加到docker组
vim /etc/docker/daemon.json
daemon.json
:
{
"registry-mirrors": ["https://zfzbet67.mirror.aliyuncs.com"]
}
docker pull summary/portainer-ce
dokcer load -i images.tar
docker run -d -p 1066:9000 -v /var/run/docker.sock:/var/run/docker.sock --restart=always --name=portainer-ce summary/portainer-ce
http://localhost:1066/
用户名:admin
密码:123465
是一个用于在 NVIDIA GPU 上运行容器应用程序的工具包。它提供了一系列的组件和工具,用于管理和优化 GPU 加速的容器化工作负载。
NVIDIA Docker 运行时(nvidia-docker2):它是一个 Docker 运行时插件,允许容器与宿主机共享 NVIDIA GPU 资源。这使得开发人员可以在容器中轻松地访问和使用 GPU 加速功能,无需进行复杂的配置。
curl
sudo apt-get install curl
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
&& curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
daemon.json
:
{
"registry-mirrors": ["https://zfzbet67.mirror.aliyuncs.com"],
"runtimes": {
"nvidia": {
"path": "/usr/bin/nvidia-container-runtime",
"runtimeArgs": []
}
}
}
sudo systemctl restart docker
sudo docker run --rm --runtime=nvidia --gpus all nvidia/cuda:11.6.2-base-ubuntu20.04 nvidia-smi
输出一下信息,安装成功。
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.51.06 Driver Version: 450.51.06 CUDA Version: 11.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Tesla T4 On | 00000000:00:1E.0 Off | 0 |
| N/A 34C P8 9W / 70W | 0MiB / 15109MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
sudo chmosd -X cuda_11.2.0_460.27.04_linux.run
suod bash cuda_11.2.0_460.27.04_linux.run
sudo vim ~/.baschrc
# 结尾添加
export PATH=/usr/bin:/usr/sbin:/usr/local/cuda-11.2/bin
export LD_LIBRARY_PATH=/usr/local/cuda-11.2/lib64
nvcc -V
# 输出以下信息安装成功
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Nov_30_19:08:53_PST_2020
Cuda compilation tools, release 11.2, V11.2.67
Build cuda_11.2.r11.2/compiler.29373293_0
cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tar.xz
tar -xvf cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tar.xz
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ZG12LLfN-1691460393859)(H:\360MoveData\Users\Administrator\Desktop\显卡环境安装包\ubuntu显卡环境安装.assets\image-20230808094350495.png)]
include
和lib
分别复制到cuda 安装目录 下的 include
和lib
sudo cp -r include/* /usr/local/cuda-11.2/include
sudo cp -r lib/* /usr/local/cuda-11.2/lib64
tar -xvf tensorrt-8.2.5.1.linux.x86_64-gnu.cuda-11.4.cudnn8.2.tar.gz
sudo mv TensorRT-8.2.5.1/ /opt
sudo vim ~/.baschrc
# 结尾添加
export PATH=/usr/bin:/usr/sbin:/usr/local/cuda-11.2/bin:/opt/TensorRT-8.2.5.1/bin
export LD_LIBRARY_PATH=/usr/local/cuda-11.2/lib64:/opt/TensorRT-8.2.5.1/lib
# 更新资源
source ~/.baschrc