配置docker 支持GPU方法(Nvidia GPU)

参考官方文档:

https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html

系统版本:ubuntu 23.04

执行脚本如下:

1.Configure the production repository:

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/stable/deb/nvidia-container-toolkit.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

Optionally, configure the repository to use experimental packages:

sed -i -e '/experimental/ s/^#//g' /etc/apt/sources.list.d/nvidia-container-toolkit.list

 

2.Update the packages list from the repository:

sudo apt-get update

3.Install the NVIDIA Container Toolkit packages:

sudo apt-get install -y nvidia-container-toolkit

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  bamfdaemon gnome-bluetooth gnome-screensaver indicator-applet indicator-application indicator-appmenu indicator-bluetooth indicator-common indicator-datetime indicator-keyboard
  indicator-messages indicator-power indicator-printers indicator-session jayatana libaccounts-glib0 libbamf3-2 libevent-2.1-7a libgnome-panel0 libido3-0.1-0 libindicator3-7
  liblightdm-gobject-1-0 libncurses5 libtinfo5 libunity-gtk2-parser0 libunity-gtk3-parser0 libunity-settings-daemon1 linux-headers-6.2.0-20 linux-headers-6.2.0-20-generic
  linux-image-6.2.0-20-generic linux-modules-6.2.0-20-generic linux-modules-extra-6.2.0-20-generic node-arg node-create-require node-make-error node-typescript node-yn
  ubuntu-touch-sounds unity-greeter unity-gtk-module-common unity-gtk2-module unity-gtk3-module unity-settings-daemon unity-settings-daemon-schemas
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libnvidia-container-tools libnvidia-container1 nvidia-container-toolkit-base
The following NEW packages will be installed:
  libnvidia-container-tools libnvidia-container1 nvidia-container-toolkit nvidia-container-toolkit-base
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,280 kB of archives.
After this operation, 17.0 MB of additional disk space will be used.
Ign:1 https://nvidia.github.io/libnvidia-container/experimental/deb/amd64  libnvidia-container1 1.15.0~rc.3-1
Ign:2 https://nvidia.github.io/libnvidia-container/experimental/deb/amd64  libnvidia-container-tools 1.15.0~rc.3-1
Ign:3 https://nvidia.github.io/libnvidia-container/experimental/deb/amd64  nvidia-container-toolkit-base 1.15.0~rc.3-1
Ign:4 https://nvidia.github.io/libnvidia-container/experimental/deb/amd64  nvidia-container-toolkit 1.15.0~rc.3-1
Ign:1 https://nvidia.github.io/libnvidia-container/experimental/deb/amd64  libnvidia-container1 1.15.0~rc.3-1
Ign:2 https://nvidia.github.io/libnvidia-container/experimental/deb/amd64  libnvidia-container-tools 1.15.0~rc.3-1
Ign:3 https://nvidia.github.io/libnvidia-container/experimental/deb/amd64  nvidia-container-toolkit-base 1.15.0~rc.3-1
Ign:4 https://nvidia.github.io/libnvidia-container/experimental/deb/amd64  nvidia-container-toolkit 1.15.0~rc.3-1
Ign:1 https://nvidia.github.io/libnvidia-container/experimental/deb/amd64  libnvidia-container1 1.15.0~rc.3-1
Get:2 https://nvidia.github.io/libnvidia-container/experimental/deb/amd64  libnvidia-container-tools 1.15.0~rc.3-1 [19.3 kB]
Get:3 https://nvidia.github.io/libnvidia-container/experimental/deb/amd64  nvidia-container-toolkit-base 1.15.0~rc.3-1 [2,394 kB]
Get:4 https://nvidia.github.io/libnvidia-container/experimental/deb/amd64  nvidia-container-toolkit 1.15.0~rc.3-1 [945 kB]                                                            
Get:1 https://nvidia.github.io/libnvidia-container/experimental/deb/amd64  libnvidia-container1 1.15.0~rc.3-1 [922 kB]                                                                
Fetched 4,280 kB in 1min 33s (45.9 kB/s)                                                                                                                                              
Selecting previously unselected package libnvidia-container1:amd64.
(Reading database ... 330620 files and directories currently installed.)
Preparing to unpack .../libnvidia-container1_1.15.0~rc.3-1_amd64.deb ...
Unpacking libnvidia-container1:amd64 (1.15.0~rc.3-1) ...
Selecting previously unselected package libnvidia-container-tools.
Preparing to unpack .../libnvidia-container-tools_1.15.0~rc.3-1_amd64.deb ...
Unpacking libnvidia-container-tools (1.15.0~rc.3-1) ...
Selecting previously unselected package nvidia-container-toolkit-base.
Preparing to unpack .../nvidia-container-toolkit-base_1.15.0~rc.3-1_amd64.deb ...
Unpacking nvidia-container-toolkit-base (1.15.0~rc.3-1) ...
Selecting previously unselected package nvidia-container-toolkit.
Preparing to unpack .../nvidia-container-toolkit_1.15.0~rc.3-1_amd64.deb ...
Unpacking nvidia-container-toolkit (1.15.0~rc.3-1) ...
Setting up nvidia-container-toolkit-base (1.15.0~rc.3-1) ...
Setting up libnvidia-container1:amd64 (1.15.0~rc.3-1) ...
Setting up libnvidia-container-tools (1.15.0~rc.3-1) ...
Setting up nvidia-container-toolkit (1.15.0~rc.3-1) ...
Processing triggers for libc-bin (2.37-0ubuntu2.2) ...

 4.check installed

which nvidia-container-runtime

(base) gw00241401@gw00241401-pc:/data2/06_application/Docker-DB-GPT$ which nvidia-container-runtime
/usr/bin/nvidia-container-runtime

 5.restart docker

sudo systemctl restart docker

6.run docker

docker run -it --gpus all ............................

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/697777.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

怎么把试卷图片转换成word?这4种方法一看就会

怎么把试卷图片转换成word?在数字化日益盛行的今天,我们常常会面临将纸质试卷或图片中的试卷内容转化为Word文档的需求。无论是为了对试卷内容进行编辑、修改,还是为了在线共享、远程教学,将图片转换为Word文档都成为了至关重要的…

集成TinyMCE富文本编辑器

若依的基础上集成TinyMCE富文本编辑器 前端bootstrap TinyMCE官网链接 TinyMCE所需静态资源下载链接 开源项目-若依链接 将TinyMCE静态资源包放入项目中&#xff1b; 代码引入css&#xff1a; <!-- 引入TinyMCE CSS --><link th:href"{/ajax/libs/tinymce/j…

金田金業: 美联储泡沫正在破裂! 崩溃对黄金非常有利

The Great Recession Blog作者大卫哈吉斯表示&#xff0c;美联储一直以来都将继续收紧货币政策&#xff0c;直到出现问题&#xff0c;但市场现在已经陷入泡沫。 他指出&#xff0c;泡沫正在破裂&#xff0c;崩溃最终将对黄金非常有利。 正当投资者聚焦美联储何时会降息&#xf…

Springboot 使用升级小记-循环依赖

springboot 使用已经非常广泛了&#xff0c;它的版本迭代速度也比较快&#xff0c;过一段时间版本差异就会比较大。 由于低版本依赖的 spring 版本有漏洞问题&#xff0c;这次我们是从 2.2.6 版本直接升级到 2.7.16&#xff0c;升级 3.0 的话担心差异更大。 这时直接修改依赖…

Jmeter 学习目录(0)

Jmeter 所有内容均以学习为主输出内容&#xff0c;按照最小单位和基础进行输出。 如果有看不懂&#xff0c;或者有不明确的内容&#xff0c;欢迎大家留言说明。 Mac Jmeter下载安装启动(1) Jmeter 目录介绍(2) Jmeter基础发起一次请求(3)

代码随想录三刷day07

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 前言一、力扣206. 反转链表二、力扣24. 两两交换链表中的节点 前言 递归写法和双指针法实质上都是从前往后翻转指针指向&#xff0c;其实还有另外一种与双指针法不同…

SD-WAN:快速改造升级企业原有网络架构

随着企业信息化的推进&#xff0c;传统网络架构已难以满足企业日益复杂和多样化的组网互联需求。企业在不断提高对网络的要求&#xff0c;包括各办公点的互联数据传输、资源共享、视频会议、ERP、OA、邮箱系统、云服务等应用需求&#xff0c;以及对网络运维工作的简化和降低难度…

Spring Event 快速入门

请直接看原文 : Spring Event&#xff0c;贼好用的业务解耦神器&#xff01; (qq.com) -------------------------------------------------------------------------------------------------------------------------------- 前言 Spring Event 同步使用 Spring Event 异…

架构篇35:微服务架构最佳实践 - 方法篇

文章目录 服务粒度拆分方法基础设施小结上一篇我们谈了实施微服务需要避免踩的陷阱,简单提炼为: 微服务拆分过细,过分强调“small”。微服务基础设施不健全,忽略了“automated”。微服务并不轻量级,规模大了后,“lightweight”不再适应。针对这些问题,我们看看微服务最佳…

ADAS智能驾驶测试知多少?

当涉及ADAS&#xff08;Advanced Driver Assistance Systems&#xff09;智能驾驶的测试时&#xff0c;有一个完整的测试体系可以用来评估系统的性能和功能。 1. 传感器测试 1.1 传感器校准测试 描述&#xff1a;确保传感器&#xff08;如雷达、摄像头、激光雷达等&#xff09;…

【stm32】hal库学习笔记-UART/USART串口通信(超详细!)

【stm32】hal库学习笔记-UART/USART串口通信 hal库驱动函数 CubeMX图形化配置 导入LCD.ioc RTC设置 时钟树配置 设置LSE为RTC时钟源 USART设置 中断设置 程序编写 编写主函数 /* USER CODE BEGIN 2 */lcd_init();lcd_show_str(10, 10, 16, "Demo12_1:USART1-CH340&q…

【PythonGIS】Python线矢量等距离取点/线等分取点点创建矢量面

不多说&#xff0c;这是之前项目需求的代码&#xff0c;已经是去年的了一直没来的及发&#xff0c;今天抽出来一丢丢的空挡发一下。主要就是利用线矢量等距离生成点矢量&#xff0c;或者直接将线矢量等分生成点矢量&#xff0c;这个需求其实极限一下就是线转点了&#xff08;将…

Java中各种O(PO,BO,DTO,VO等) 是不是人为增加系统复杂度?

Java中各种O(PO,BO,DTO,VO等) 是不是人为增加系统复杂度&#xff1f; 在Java和其他编程语言的开发过程中&#xff0c;经常会用到几个以"O"结尾的缩写&#xff0c;比如PO,BO,DTO,VO等等&#xff0c;O在这里是Object的缩写&#xff0c;不同的O代表了不同的数据类型&am…

onlyoffice7.5.1 实现填写表单 word+html form双向绑定功能

说明&#xff1a;目前官方已经更新wordhtml为8.0以前的&#xff0c;目前官方新版本8.0增加了pdf绑定&#xff0c;这个我考虑在以后研究努力实现。 onlyoffice双向绑定form表单数据

Java基础 - 13 Queue之DelayQueue、PriorityQueue、PriorityBlockingQueue讲解

在Java的队列世界里&#xff0c;有三位大佬&#xff0c;他们分别是DelayQueue、PriorityQueue和PriorityBlockingQueue。今天&#xff0c;让我们一起揭开他们神秘的面纱&#xff0c;看看他们各自的特点和用途吧&#xff01; DelayQueue 首先&#xff0c;让我们来认识一下Delay…

2.22 作业

顺序表 运行结果 fun.c #include "fun.h" seq_p create_seq_list() {seq_p L (seq_p)malloc(sizeof(seq_list));if(LNULL){printf("空间申请失败\n");return NULL;}L->len 0; bzero(L,sizeof(L->data)); return L; } int seq_empty(seq_p L) {i…

工厂方法模式Factory Method

1.模式定义 定义一个用于创建对象的接口&#xff0c;让子类决定实例化哪一个类。Factory Method 使得一个类的实例化延迟到子类 2.使用场景 1.当你不知道改使用对象的确切类型的时候 2.当你希望为库或框架提供扩展其内部组件的方法时 主要优点&#xff1a; 1.将具体产品和创建…

PHP+vue+mysql仓库进销存管理系统8jeqj

开发语言&#xff1a;php 后端框架&#xff1a;Thinkphp 前端框架&#xff1a;vue.js 服务器&#xff1a;apache 数据库&#xff1a;mysql 运行环境:phpstudy/wamp/xammp等 数据库工具&#xff1a;Navicat/phpmyadmin 登录模块&#xff1a;此模块主要有4个部分&#xff0c;基…

实验中用户行为的检测

[1] Makris S , Karagiannis P , Koukas S ,et al.Augmented reality system for operator support in human–robot collaborative assembly[J].CIRP Annals - Manufacturing Technology, 2016:S0007850616300385.DOI:10.1016/j.cirp.2016.04.038. —————————————…

gem5学习(24):缓存一致性协议——Cache Coherence Protocols

目录 一、Common Notations and Data Structures 1、Coherence Messages 2、Access Permissions 3、Data Structures 二、Coherence controller FSM Diagrams 官网教程&#xff1a;gem5: Cache Coherence Protocols 一、Common Notations and Data Structures &#xff…