Skip to content

k3s with nvidia gpu not working as intended #8596

Answered by unixbird
unixbird asked this question in Q&A
Discussion options

You must be logged in to vote

So I got it working (under kubeadm with crio but this should work with k3s as well). Turns out I'm not the only one who discovered this with similar issues. As described here and partly in the k3s advanced docs you need to do a couple things after installing your gpu driver and setting up the nvidia-container-runtime.

  1. Separate the nvidia runtime kind block from the example k3s advanced options and deploy it.
  2. You need to edit the nvidia-device-plugin from this yaml and add the runtimeClassName: nvidia to it in the pod spec (I cut out most of the yaml but this is where it should go):
spec:
      tolerations:
      - key: nvidia.com/gpu
        operator: Exists
        effect: NoSchedule
 …

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@brandond
Comment options

@unixbird
Comment options

@unixbird
Comment options

@brandond
Comment options

@unixbird
Comment options

Comment options

You must be logged in to vote
1 reply
@neofob
Comment options

Answer selected by unixbird
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #8595 on October 12, 2023 04:17.