docker GPU安装

docker 离线安装

docker下载地址:https://download.docker.com/linux/static/stable/x86_64/

解压:

python 复制代码
tar xzvf docker-24.0.6.tgz

移动解压后的内容

python 复制代码
sudo mv docker/* /usr/local/bin/

创建 docker.service配置文件

python 复制代码
sudo vim /etc/systemd/system/docker.service

把下面的内容复制到配置文件中并保存退出

python 复制代码
[Unit]
Description=Docker Application Container Engine
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=notify
ExecStart=/usr/local/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
Restart=always
RestartSec=2
StartLimitBurst=3
StartLimitInterval=60s
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Delegate=yes
KillMode=process

[Install]
WantedBy=multi-user.target

依次添加配置文件权限、加载配置文件、启动Docker,命令如下:

python 复制代码
sudo chmod +x /etc/systemd/system/docker.service
sudo systemctl daemon-reload
sudo systemctl start docker

查看Docker是否已在运行

python 复制代码
sudo systemctl status docker

查看Docker版本号以进一步验证Docker是否安装成功

python 复制代码
sudo docker --version

将Docker服务设置为开机自启动

python 复制代码
sudo systemctl enable docker

离线安装NVIDIA Container Toolkit

想要使用GPU,需要安装这个

NVIDIA Container Toolkit下载地址:https://github.com/NVIDIA/libnvidia-container/tree/gh-pages/stable/deb/amd64

查询对应版本进行安装:

安装命令示例:

python 复制代码
sudo dpkg -i ./xxx.deb

查看NVIDIA Container Toolkit的版本以验证是否安装成功

python 复制代码
nvidia-ctk --version

设置Docker默认使用NVIDIA runtime

python 复制代码
sudo nvidia-ctk runtime configure --runtime=docker

重启Docker

python 复制代码
sudo systemctl restart docker

参考:https://zhuanlan.zhihu.com/p/15194336245

相关推荐
灯澜忆梦4 小时前
【minio】#1 | 简介与安装
docker·对象存储·minio
江湖有缘14 小时前
3款开源绘图工具整理合集,可Docker一键部署!
docker·容器·开源
TTATTC15 小时前
告别协议选型内耗:深入拆解微服务“内部 gRPC + 边界 REST”混合通信架构与 Envoy 转码实战
docker·开源
光依旧1 天前
PageIndex没翻车,翻车的是我的解析器
docker·langchain·大模型·向量数据库·pdf解析·rag·pageindex
谢亮_vipxieliang1 天前
容器排障实战手册:从日志到内核的分层排障
docker·云原生·容器·eureka
梦想不只是梦与想2 天前
Docker 常用命令
docker
小白的码BUG之路2 天前
Docker -- 构建ruoyi-gateway镜像
docker·容器·gateway
小白的码BUG之路2 天前
Docker -- 构建ruoyi-system镜像
运维·docker·容器
小白的码BUG之路2 天前
Docker -- 构建redis镜像
运维·docker·容器
江湖有缘2 天前
Docker实战 | 使用Docker部署EspoCRM开源客户关系管理平台
docker·容器·开源