Edward Chang
Edward Chang

Reputation: 151

How to set --runtime nvidia in YAML file of k3s pod deployment for a GPU application?

Jetson Xavier NX

I want to run a GPU program in a k3s pod, but it shows the error

ImportError: libnppicc.so.10: cannot open shared object file: No such file or directory

it seems it cannot use GPU resource, because when I use docker run --runtime nvidia ... it works. How to set something like "--runtime nvidia" in the YAML for k3s deployment?

Upvotes: 0

Views: 862

Answers (1)

Rakesh Gupta
Rakesh Gupta

Reputation: 3780

Follow this article: https://dev.to/mweibel/add-nvidia-gpu-support-to-k3s-with-containerd-4j17

--- Below does not work - the download link is broken ---

1. First configure the containerd to use the nvidia-container-runtime plugin

$ sudo wget https://k3d.io/usage/guides/cuda/config.toml.tmpl -O /var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl

2. Install NVIDIA device plugin for Kubernetes

$ cat <<EOF | kubectl apply -f -
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
  name: nvidia-device-plugin
  namespace: kube-system
spec:
  chart: nvidia-device-plugin
  repo: https://nvidia.github.io/k8s-device-plugin
EOF

Reference: https://itnext.io/enabling-nvidia-gpus-on-k3s-for-cuda-workloads-a11b96f967b0

Upvotes: 1

Related Questions