From 2a63db4e6f252d2a8d9ff438a60be301daf7cf25 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 27 Feb 2024 12:50:59 +0000 Subject: [PATCH] nixos/virtualisation.containers.cdi.dynamic.nvidia: expose driverLink ..shallowly --- .../cdi-generate.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nixos/modules/services/hardware/nvidia-container-toolkit-cdi-generator/cdi-generate.nix b/nixos/modules/services/hardware/nvidia-container-toolkit-cdi-generator/cdi-generate.nix index efa0243aa782..1aaa2d07b9bd 100644 --- a/nixos/modules/services/hardware/nvidia-container-toolkit-cdi-generator/cdi-generate.nix +++ b/nixos/modules/services/hardware/nvidia-container-toolkit-cdi-generator/cdi-generate.nix @@ -1,4 +1,5 @@ { + addDriverRunpath, glibc, jq, lib, @@ -10,6 +11,7 @@ let mountOptions = { options = ["ro" "nosuid" "nodev" "bind"]; }; mounts = [ + # FIXME: Making /usr mounts optional { hostPath = lib.getExe' nvidia-driver "nvidia-cuda-mps-control"; containerPath = "/usr/bin/nvidia-cuda-mps-control"; } { hostPath = lib.getExe' nvidia-driver "nvidia-cuda-mps-server"; @@ -24,6 +26,14 @@ let containerPath = "/usr/bin/nvidia-ctk"; } { hostPath = "${lib.getLib glibc}/lib"; containerPath = "${lib.getLib glibc}/lib"; } + + # FIXME: use closureinfo + { + hostPath = addDriverRunpath.driverLink; + containerPath = addDriverRunpath.driverLink; + } + { hostPath = "${lib.getLib glibc}/lib"; + containerPath = "${lib.getLib glibc}/lib"; } { hostPath = "${lib.getLib glibc}/lib64"; containerPath = "${lib.getLib glibc}/lib64"; } ];