Docker离线安装Nvidia-container-toolkit实现容器内GPU调用

背景

需求:实验室内通过Docker搭建隔离环境保证各用户数据安全和服务器环境安全,防止软件环境混杂造成莫名其妙的bug,容器内需要能够调用显卡资源。

预先准备

本文的内容基于以下软件版本:
Docker:Docker version 20.10.17, build 100c701
CUDA:NVIDIA-SMI 510.68.02 Driver Version: 510.68.02 CUDA Version: 11.6
系统:Ubuntu 20.04.4 LTS

Nvidia-container-toolkit架构

Nvidia官网架构概述,可以用Chrome自带网页翻译仔细阅读,本文仅简单介绍。

架构

The NVIDIA container stack is architected so that it can be targeted to support any container runtime in the ecosystem.
The components of the stack include:
	The nvidia-docker wrapper
	The NVIDIA Container Runtime (nvidia-container-runtime)
	The NVIDIA Container Runtime Hook (nvidia-container-toolkit / nvidia-container-runtime-hook)
	The NVIDIA Container Library and CLI (libnvidia-container1, nvidia-container-cli)
...
Note that as of version 3.6.0, the nvidia-container-runtime package is a meta package that 
only depends on the nvidia-container-toolkit package and does not provide any functionality of itself.

NVIDIA container主要组件包括nvidia-container-runtime, nvidia-container-toolkit, libnvidia-containerCUDA驱动;
在3.6.0版本后,runtime包成为一个只依赖于toolkit包(指container-toolkit而不是nvidia CUDA toolkit)的包,在官网中也指出&#

  • 14
    点赞
  • 65
    收藏
    觉得还不错? 一键收藏
  • 23
    评论
评论 23
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值