File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
modules/services/hardware/nvidia-container-toolkit Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ writeScriptBin "nvidia-cdi-generator" ''
3939 --device-name-strategy ${ device-name-strategy } \
4040 --ldconfig-path ${ lib . getExe' glibc "ldconfig" } \
4141 --library-search-path ${ lib . getLib nvidia-driver } /lib \
42- --nvidia-cdi-hook-path ${ lib . getExe' nvidia-container-toolkit . tools " nvidia-cdi-hook" } \
42+ --nvidia-cdi-hook-path ${ lib . getOutput "tools" nvidia-container-toolkit } /bin/ nvidia-cdi-hook \
4343 ${ lib . escapeShellArgs extraArgs }
4444 }
4545
Original file line number Diff line number Diff line change 8585 '' ;
8686 meta . mainProgram = "nvidia-ctk" ;
8787 } ;
88+ suppressNvidiaDriverAssertion = true ;
8889 } ;
8990in
9091{
100101 {
101102 environment . systemPackages = with pkgs ; [ jq ] ;
102103 virtualisation . diskSize = lib . mkDefault 10240 ;
103- virtualisation . containers . enable = lib . mkDefault true ;
104+ virtualisation . containers = {
105+ containersConf . settings . engine . cdi_spec_dirs = [ "/var/run/cdi" ] ;
106+ enable = lib . mkDefault true ;
107+ } ;
104108 hardware = {
105109 inherit nvidia-container-toolkit ;
106110 nvidia = {
113117 nodes = {
114118 no-gpus = {
115119 virtualisation . containers . enable = false ;
116- hardware . graphics . enable = false ;
117120 } ;
121+
118122 one-gpu =
119123 { pkgs , ... } :
120124 {
142146 one_gpu.wait_for_unit("nvidia-container-toolkit-cdi-generator.service")
143147 one_gpu.succeed("cat /var/run/cdi/nvidia-container-toolkit.json | jq")
144148 one_gpu.succeed("podman load < ${ testContainerImage } ")
145- print( one_gpu.succeed("podman run --pull=never --device=nvidia.com/gpu=all -v /run/opengl-driver:/run/opengl-driver:ro cdi-test:latest") )
149+ one_gpu.succeed("podman run --pull=never --device=nvidia.com/gpu=all -v /run/opengl-driver:/run/opengl-driver:ro cdi-test:latest")
146150
147151 # Issue: https://github.com/NixOS/nixpkgs/issues/319201
148152 with subtest("The generated CDI spec skips specified non-existant paths in the host"):
You can’t perform that action at this time.
0 commit comments