Skip to content

Commit 97fa52c

Browse files
committed
fix: set wsl.useWindowsDriver when the nvidia-ctk is enabled
This improves the user experience as whenever the user enables the `config.hardware.nvidia-container-toolkit.enable` option, they cannot use their Nvidia GPU's within the Docker containers because of missing libraries. This gets fixed by setting `wsl.useWindowsDriver` explicitly when the user requests to enable GPU support on Docker containers. Issue and fix provided by @qwqawawow Related: #433 Related: NVIDIA/nvidia-container-toolkit#452
1 parent 041bad0 commit 97fa52c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

modules/docker-desktop.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ with builtins; with lib; {
3636
config.wsl.defaultUser
3737
];
3838

39+
# Related issues:
40+
# - https://github.com/nix-community/NixOS-WSL/issues/433
41+
# - https://github.com/NVIDIA/nvidia-container-toolkit/issues/452
42+
#
43+
# By setting `useWindowsDriver` to true, the Nvidia libraries are properly
44+
# mounted on the container from the host.
45+
wsl.useWindowsDriver = mkIf config.hardware.nvidia-container-toolkit.enable true;
46+
3947
};
4048

4149
}

0 commit comments

Comments
 (0)