Skip to content

Commit 1f90504

Browse files
authored
Merge pull request #501 from sky1122/add-two-patches-k8s-device-plugin
nvidia-k8s-device-plugin: add ldcache parsing for aarch64 patch
2 parents 02b5cda + cca2da5 commit 1f90504

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
From be4ba83b821eea9050eefdb7e67df2d757c3795a Mon Sep 17 00:00:00 2001
2+
From: Jingwei Wang <[email protected]>
3+
Date: Wed, 23 Apr 2025 17:17:35 +0000
4+
Subject: [PATCH] fix ldcache parsing for aarch64
5+
6+
k8s-device-plugin carries its own nvidia-container-toolkit and uses
7+
nvidia-ctk to generate the CDI specifications.
8+
9+
The architecture flag for aarch64 is currently missing from the
10+
supported architecture flags list. This omission causes the getEntries
11+
function to exclude all libraries found on aarch64 hosts. As a result
12+
helper programs like nvidia-ctk are unable to generate CDI
13+
specifications for the aarch64 architecture.
14+
15+
This fix adds the missing aarch64 architecture flag, using the same
16+
value as defined in libnvidia-container[1], which maintains a more
17+
comprehensive list of supported architectures.
18+
19+
[1]: https://github.com/NVIDIA/libnvidia-container/blob/a198166e1c1166f4847598438115ea97dacc7a92/src/ldcache.h#L21
20+
21+
Signed-off-by: Jingwei Wang <[email protected]>
22+
---
23+
.../nvidia-container-toolkit/internal/ldcache/ldcache.go | 3 +++
24+
1 file changed, 3 insertions(+)
25+
26+
diff --git a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/ldcache/ldcache.go b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/ldcache/ldcache.go
27+
index 4daf95b..455048c 100644
28+
--- a/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/ldcache/ldcache.go
29+
+++ b/vendor/github.com/NVIDIA/nvidia-container-toolkit/internal/ldcache/ldcache.go
30+
@@ -47,6 +47,7 @@ const (
31+
flagArchX8664 = 0x0300
32+
flagArchX32 = 0x0800
33+
flagArchPpc64le = 0x0500
34+
+ flagArchAarch64 = 0x0a00
35+
)
36+
37+
var errInvalidCache = errors.New("invalid ld.so.cache file")
38+
@@ -195,6 +196,8 @@ func (c *ldcache) getEntries() []entry {
39+
switch e.Flags & flagArchMask {
40+
case flagArchX8664:
41+
fallthrough
42+
+ case flagArchAarch64:
43+
+ fallthrough
44+
case flagArchPpc64le:
45+
bits = 64
46+
case flagArchX32:
47+
--
48+
2.47.0
49+

packages/nvidia-k8s-device-plugin/nvidia-k8s-device-plugin.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Source2: nvidia-k8s-device-plugin-conf
1818
Source3: nvidia-k8s-device-plugin-exec-start-conf
1919
Source4: nvidia-k8s-device-plugin-mig-conf
2020

21+
Patch0001: 0001-fix-ldcache-parsing-for-aarch64.patch
2122

2223
BuildRequires: %{_cross_os}glibc-devel
2324
Requires: %{name}(binaries)

0 commit comments

Comments
 (0)