為什麼我的 NVIDIA GPU 驅動程式在 RHEL 9 工作節點上安裝失敗?

虛擬私有雲 經典基礎架構

當您嘗試在 Red Hat Enterprise Linux 9 工作者節點上安裝 NVIDIA GPU 驅動程式時,安裝會因儲存庫錯誤而失敗。

您在 nvidia-driver-daemonset-* pod 日誌中看到類似以下的錯誤訊息:

Error: Unable to find a match: kernel-headers-VERSION kernel-devel-VERSION

例如:

Error: Unable to find a match: kernel-headers-5.14.0-570.112.1.el9_6.x86_64 kernel-devel-5.14.0-570.112.1.el9_6.x86_64

NVIDIA GPU Operator 未為 RHEL 9 工作節點啟用所有必要的 Extended Update Support (EUS) 套件庫。 雖然 Red Hat OpenShift on IBM Cloud 中的 RHEL 9 工作節點已啟用 EUS 儲存庫,但 NVIDIA 驅動程式的安裝需要額外的儲存庫設定。

套用 ConfigMap,啟用 NVIDIA GPU 驅動程式安裝所需的 EUS 套件庫。

  1. SSH 到您的一個 RHEL 9 工作節點,擷取所需的儲存庫組態值。

    oc debug node/<worker-node-name>
    
  2. 存取主機檔案系統。

    chroot /host
    
  3. 檢視 Red Hat 儲存庫組態以擷取所需的值。

    cat /etc/yum.repos.d/redhat.repo
    
  4. 從輸出中找到 [rhel-9-for-x86_64-appstream-eus-rpms] 區段,並記下下列值:

    • baseurl- 儲存庫的基本 URL
    • sslclientkey- SSL 用戶端金鑰的路徑 (包含憑證序號)
    • sslclientcert- SSL 用戶端憑證的路徑(包含相同的憑證序號)

    憑證序號同時出現在 sslclientkeysslclientcert 路徑中。 例如,如果路徑是 /etc/pki/entitlement-host/1234567890123456789-key.pem/etc/pki/entitlement-host/1234567890123456789.pem,證書序號就是 1234567890123456789

  5. 退出除錯會話。

    exit
    exit
    
  6. 建立 ConfigMap 檔案,名稱為 nvidia-driver-repo-config.yaml,內容如下。 以安裝 GPU 驅動程式的命名空間取代 NAMESPACE-GPU,以您擷取的基本 URL 取代 BASEURL,並以您的憑證序號取代 CERT-SERIAL 的兩個實例。

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: nvidia-driver-repo-config
      namespace: NAMESPACE-GPU
    data:
      rhel9.repo: |
        [ibm-rhel-9-for-x86_64-appstream-eus-rpms]
        name = Red Hat Enterprise Linux 9 for x86_64 - AppStream - Extended Update Support (RPMs)
        baseurl = BASEURL/pulp/repos/customer/Library/content/eus/rhel9/9.6/x86_64/appstream/os
        enabled = 1
        gpgcheck = 1
        gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
        sslverify = 1
        sslcacert = /etc/rhsm-host/ca/katello-server-ca.pem
        sslclientkey = /etc/pki/entitlement-host/CERT-SERIAL-key.pem
        sslclientcert = /etc/pki/entitlement-host/CERT-SERIAL.pem
        metadata_expire = 1
        enabled_metadata = 0
    
  7. 將 ConfigMap 套用至您的群集。

    oc apply -f nvidia-driver-repo-config.yaml
    
  8. 編輯群集政策,將 ConfigMap 加入 repoConfig 區段。

    oc edit clusterpolicy
    
  9. spec.repoConfigconfigMapName 欄位加入您的 ConfigMap 名稱。

    spec:
      ...
      repoConfig:
        configMapName: nvidia-driver-repo-config
      ...
    
  10. 刪除 NVIDIA 驅動程式 daemonset pod,使其循環並套用新設定。

oc delete po nvidia-driver-daemonset-*

在 pod 重新啟動後,NVIDIA GPU Operator 可以存取所需的 EUS 套件庫,並成功在您的 RHEL 9 工作節點上安裝 GPU 驅動程式。