Skip to content

Commit

Permalink
fix: set wsl.useWindowsDriver when the nvidia-ctk is enabled
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ereslibre committed May 20, 2024
1 parent 041bad0 commit 02f4967
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/docker-desktop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ with builtins; with lib; {
config.wsl.defaultUser
];

# Related issue:
# - https://github.com/nix-community/NixOS-WSL/issues/433
#
# By setting `useWindowsDriver` to true, the Nvidia libraries are properly
# mounted on the container from the host.
wsl.useWindowsDriver = mkIf config.hardware.nvidia-container-toolkit.enable true;

};

}

0 comments on commit 02f4967

Please sign in to comment.