Skip to content

Commit 27b9f65

Browse files
authored
Merge pull request #2525 from NVIDIA/device-plugin-feature-driver-ctr-ready
[state-device-plugin] infer feature enablement envars from kernel modules
2 parents 107b3c0 + 18220f4 commit 27b9f65

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

assets/state-device-plugin/0400_configmap.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,35 @@ data:
1818
set -o allexport
1919
cat /run/nvidia/validations/driver-ready
2020
. /run/nvidia/validations/driver-ready
21+
22+
extra_modules="gdrdrv nvidia_fs"
23+
> feature-flags.env
24+
for module in ${extra_modules}; do
25+
if lsmod | grep -q "^$module "; then
26+
case "$module" in
27+
"gdrdrv")
28+
if [ -z "$GDRCOPY_ENABLED" ]; then
29+
echo "GDRCOPY_ENABLED=true" >> feature-flags.env
30+
fi
31+
;;
32+
"nvidia_fs")
33+
if [ -z "$GDS_ENABLED" ]; then
34+
echo "GDS_ENABLED=true" >> feature-flags.env
35+
fi
36+
if [ -z "$MOFED_ENABLED" ]; then
37+
echo "MOFED_ENABLED=true" >> feature-flags.env
38+
fi
39+
;;
40+
esac
41+
fi
42+
done
43+
44+
if [ -s "feature-flags.env" ]; then
45+
echo "Enabling nvidia-device-plugin feature flags..."
46+
cat feature-flags.env
47+
. ./feature-flags.env
48+
fi
2149
2250
echo "Starting nvidia-device-plugin"
2351
exec nvidia-device-plugin
52+

0 commit comments

Comments
 (0)