一篇关于显卡驱动部署的记录(容器环境)centos7

[驱动下载地址](https://www.nvidia.cn/geforce/drivyum install nvidia-container-runtimeers/)
关于驱动安装及卸载
直接
chmod +x *.run 这个驱动
sh *.run (这个驱动名)
卸载(centos系统)

/usr/bin/nvidia-uninstall 

宿主机安装驱动 容器如何调用?
1.安装nvidia-container-runtime

distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.repo | \
sudo tee /etc/yum.repos.d/nvidia-container-runtime.repo

安装

yum install nvidia-container-runtime

测试

docker run -it --rm --gpus all centos nvidia-smi

yaml调用:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: gpu-master
  namespace: gpu
spec:
  replicas: 1
  selector:
    matchLabels:
      app: gpu-master
  template:
    metadata:
      labels:
        app: gpu-master
    spec:
      hostname: gpu-master
      containers:
      - name: gpu-master
        image: 192.168.168.10:5000/library/pytorch-gpu:v3
        env:
        - name: NVIDIA_DRIVER_CAPABILITIES
          value: compute,utility
        - name: NVIDIA_VISIBLE_DEVICES
          value: all
        securityContext:
          privileged: true
          runAsUser: 0
        resources:
           limits:
             nvidia.com/gpu: "1"
           requests:
             nvidia.com/gpu: "1"
        volumeMounts:
        - name: code-host-path
          mountPath: /persistent
      volumes:
      - name: code-host-path
        hostPath:
           path: /root/gpu/gpucod

在这里插入图片描述
部署起来后进入pod查看
在这里插入图片描述参考文档地址
参考文档地址
一些问题排查的文档
排查文档
参考链接
查的东西比较多 都列了下
官网的一些版本说明及兼容行问题

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值