Skip to main content

Install NVIDIA GPU Support

Enable GPU support (both cloud/edge)

Execute on the cloud:

kubectl apply -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v0.13.0/nvidia-device-plugin.yml

Modify edgecore.yaml on the edge:

vim /etc/kubeedge/config/edgecore.yaml
# Modify the follwoing part:
devicePluginEnabled: true

# Restart edgecore
systemctl restart edgecore.service

Modify /etc/dockerdaemon.json on all cloud/edge devices, and add the following content:

{
"default-runtime": "nvidia",
"runtimes": {
"nvidia": {
"path": "nvidia-container-runtime",
"runtimeArgs": []
}
},
}

Check running state

On the cloud, use kubectl get pods -A to find all the nvidia related pods. Then, use kubectl logs xxx -n xxx or kubectl describe pod xxx -n xxx to check pod state.

Pod state on the cloud:

nvidia-plugin1.png

nvidia-plugin2.png

Pod state on the edge:

nvidia-plugin3.png

nvidia-plugin4.png

Run the demo container on the cloud to check whether nvidia gpu can be obtained normally:

kubectl run -i -t nvidia --image=jitteam/devicequery

nvidia-plugin5.png