這邊紀錄使用NVIDIA k8s-device-plugin遇到的坑,如果看官網描述會感覺很簡單,大概幾個步驟安裝就結束了,我是真的遇到一堆坑花了很多時間才解決。
第一坑遇到了安裝完後,無法看到GPU資源的問題,中間我換過不同版本的Plugin,也試著自己Docker build plugin,但都無法解決問題,這時候看Plugin錯誤訊息如下,顯示無法載入NVML模組。
# 錯誤訊息
Loading NVML
Failed to initialize NVML: could not load NVML library.
If this is a GPU node, did you set the docker default runtime to `nvidia`?
You can check the prerequisites at: https://github.com/NVIDIA/k8s-device-plugin#prerequisites
You can learn how to set the runtime at: https://github.com/NVIDIA/k8s-device-plugin#quick-start
後來跟大神友人討論之後,他懷疑是CRI-O的問題,結果還真的是這問題,詳情請看這邊,接著我重建Cluster,不使用CRI-O就可以找到GPU資源,所以如果安裝完後找不到GPU資源,那可能是這個原因,以下就簡單紀錄安裝過程。
