<p>I want to run some gpu workloads on my bare metal k8s cluster. So I have installed the nvidia containerd runtime engine on my cluster. But the cilium cni pods crashes when I make nvidia the default runtime. (I'll post about that some other place)</p>
<p>I'm thinking I should be able to work around this problem by scheduling only the gpu pods on the nvidia runtime and leave runc as the default. Is it possible to specify different runtime engines for different workloads? Is this a good workaround? If so, how do I configure it?</p>
<p>This is how I've install the nvidia drivers and containerd runtime <a href="https://docs.nvidia.com/datacenter/cloud-native/kubernetes/install-k8s.html#option-2-installing-kubernetes-using-kubeadm" rel="nofollow noreferrer">https://docs.nvidia.com/datacenter/cloud-native/kubernetes/install-k8s.html#option-2-installing-kubernetes-using-kubeadm</a></p>
<p>I found this documentation, but it's a little dry <a href="https://kubernetes.io/docs/concepts/containers/runtime-class/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/containers/runtime-class/</a></p>

d s
<p>well... I feel dumb for not reading the docs more closely. Here I am to answer my own question.</p>
<ol>
<li>create a RuntimeClass like this:</li>
</ol>
<pre><code>kind: RuntimeClass
apiVersion: node.k8s.io/v1
metadata:
    name: nvidia
handler: nvidia
</code></pre>
<ol start="2">
<li>add <code>runtimeClassName: nvidia</code> to the container spec of any containers that you want to use the nvidia containerd engine.</li>
</ol>
<p>Thats all. It just works.</p>
