From 374282761fdfe47869257e1217a35d25e975784a Mon Sep 17 00:00:00 2001
From: Tariq Ibrahim <tibrahim@nvidia.com>
Date: Fri, 18 Apr 2025 11:30:02 -0700
Subject: [PATCH] [RHEL] install libnvsdm packages to support nvl5+ systems

Signed-off-by: Tariq Ibrahim <tibrahim@nvidia.com>
---
 rhel8/Dockerfile | 4 ++++
 rhel9/Dockerfile | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/rhel8/Dockerfile b/rhel8/Dockerfile
index e8dff7b..ef39daf 100644
--- a/rhel8/Dockerfile
+++ b/rhel8/Dockerfile
@@ -84,6 +84,10 @@ RUN if [ "$DRIVER_TYPE" != "vgpu" ] && [ "$DRIVER_BRANCH" -ge "550" ]; then \
 RUN if [ "$DRIVER_TYPE" != "vgpu" ] && [ "$DRIVER_BRANCH" -ge "570" ]; then \
     dnf install -y infiniband-diags nvlsm; fi
 
+# libnvsdm packages are not available for arm64
+RUN if [ "$DRIVER_TYPE" != "vgpu" ] && [ "$DRIVER_BRANCH" -ge "570" ] && [ "$TARGETARCH" != "arm64" ]; then \
+    dnf install -y libnvsdm-${DRIVER_BRANCH}-${DRIVER_VERSION}-1; fi
+
 COPY nvidia-driver /usr/local/bin
 COPY ocp_dtk_entrypoint /usr/local/bin
 COPY common.sh /usr/local/bin
diff --git a/rhel9/Dockerfile b/rhel9/Dockerfile
index a63c990..947c056 100644
--- a/rhel9/Dockerfile
+++ b/rhel9/Dockerfile
@@ -78,6 +78,10 @@ RUN if [ "$DRIVER_TYPE" != "vgpu" ] && [ "$DRIVER_BRANCH" -ge "550" ]; then \
 RUN if [ "$DRIVER_TYPE" != "vgpu" ] && [ "$DRIVER_BRANCH" -ge "570" ]; then \
     dnf install -y infiniband-diags nvlsm; fi
 
+# libnvsdm packages are not available for arm64
+RUN if [ "$DRIVER_TYPE" != "vgpu" ] && [ "$DRIVER_BRANCH" -ge "570" ] && [ "$TARGETARCH" != "arm64" ]; then \
+    dnf install -y libnvsdm-${DRIVER_BRANCH}-${DRIVER_VERSION}-1; fi
+
 COPY nvidia-driver /usr/local/bin
 COPY ocp_dtk_entrypoint /usr/local/bin
 COPY common.sh /usr/local/bin
-- 
GitLab