-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support CUDA in WSL2 #44
Conversation
extraBuildCommands = '' | ||
if [[ -d /usr/lib/wsl ]] | ||
then | ||
cp -rsHf /usr/lib/wsl usr/lib/wsl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we symlink?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cp -rsHf
is already symlinking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems cp -rsHf
is used in nixpkgs to link other libraries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closed in favor of #47. |
Won't these symlinks just become self-referential once the FHS environment is created? Hard links are a no-go as well since wsl/libs and wsl/drivers are actually mount points to a different filesystem... I think the only way to avoid making a full copy would be if we could prevent /usr/lib/wsl from being unshared by bwrap in the first place... |
So I managed to get this working by overriding
probably best for this sort of thing to added to buildFHSUserEnvBubblewrap itself rather than being re-implemented in every package that uses it. |
/usr/lib/wsl/lib
includes CUDA drivers for WSL2, which should be exposed to the FHS environment in order to use CUDA.Note that both this PR and nix-community/NixOS-WSL#221 are required in order to enable CUDA in WSL2 in the VS Code Terminal