From 5786d3fbd96d3f8dcb00498072368711f1235307 Mon Sep 17 00:00:00 2001 From: "Yang, Bo" Date: Thu, 4 Jan 2024 18:29:46 +0000 Subject: [PATCH 1/2] Hard-code file names when making symlink for drivers --- modules/wsl-distro.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/modules/wsl-distro.nix b/modules/wsl-distro.nix index 7bfa555d..428a4e80 100644 --- a/modules/wsl-distro.nix +++ b/modules/wsl-distro.nix @@ -77,7 +77,24 @@ in extraPackages = mkIf cfg.useWindowsDriver [ (pkgs.runCommand "wsl-lib" { } '' mkdir "$out" - ln -s /usr/lib/wsl/lib "$out/lib" + ln -s /usr/lib/wsl/lib/libcudadebugger.so.1 "$out/lib" + ln -s /usr/lib/wsl/lib/libcuda.so "$out/lib" + ln -s /usr/lib/wsl/lib/libcuda.so.1 "$out/lib" + ln -s /usr/lib/wsl/lib/libcuda.so.1.1 "$out/lib" + ln -s /usr/lib/wsl/lib/libd3d12core.so "$out/lib" + ln -s /usr/lib/wsl/lib/libd3d12.so "$out/lib" + ln -s /usr/lib/wsl/lib/libdxcore.so "$out/lib" + ln -s /usr/lib/wsl/lib/libnvcuvid.so "$out/lib" + ln -s /usr/lib/wsl/lib/libnvcuvid.so.1 "$out/lib" + ln -s /usr/lib/wsl/lib/libnvdxdlkernels.so "$out/lib" + ln -s /usr/lib/wsl/lib/libnvidia-encode.so "$out/lib" + ln -s /usr/lib/wsl/lib/libnvidia-encode.so.1 "$out/lib" + ln -s /usr/lib/wsl/lib/libnvidia-ml.so.1 "$out/lib" + ln -s /usr/lib/wsl/lib/libnvidia-opticalflow.so "$out/lib" + ln -s /usr/lib/wsl/lib/libnvidia-opticalflow.so.1 "$out/lib" + ln -s /usr/lib/wsl/lib/libnvoptix.so.1 "$out/lib" + ln -s /usr/lib/wsl/lib/libnvwgf2umx.so "$out/lib" + ln -s /usr/lib/wsl/lib/nvidia-smi "$out/lib" '') ]; }; From e7aa39a9a32c9c29d751913f19ada20a25e9baa4 Mon Sep 17 00:00:00 2001 From: Sandro Date: Mon, 8 Jan 2024 16:21:24 +0100 Subject: [PATCH 2/2] Add comment --- modules/wsl-distro.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/wsl-distro.nix b/modules/wsl-distro.nix index 428a4e80..8b4150ea 100644 --- a/modules/wsl-distro.nix +++ b/modules/wsl-distro.nix @@ -77,6 +77,7 @@ in extraPackages = mkIf cfg.useWindowsDriver [ (pkgs.runCommand "wsl-lib" { } '' mkdir "$out" + # # we cannot just symlink the lib directory because it breaks merging with other drivers that provide the same directory ln -s /usr/lib/wsl/lib/libcudadebugger.so.1 "$out/lib" ln -s /usr/lib/wsl/lib/libcuda.so "$out/lib" ln -s /usr/lib/wsl/lib/libcuda.so.1 "$out/lib"