Issues with systemRequiredFeatures = [ "cuda" ] #147
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In #146 we tried to enable the
nixmechanism to handle cuda inside the sandbox. It did not work.Findings
libcudais in/run/opengl-driver/lib; which is set in the paths added to the nvidia mounts (the entry is duplicated, but I don't think that should be any issue?):There is a hook
addDriverRunpathwhich adds/run/opengl-driver/libto therpathof the binaries. This is used in both triton, cudaPackages.saxpy and all other uses ofsystemRequiredFeatures = [ "cuda" ];The binary is indeed properly patched, and can run from a shell without problems:
It seems that
/run/opengl-driveris present in the sandbox, and we can see the link to the derivation containing the machine's graphic drivers, but we cannot actually access any further:strace of
ls /run/opengl-driver/duringinstallCheckPhase:If we hardcode
ls -l /nix/store/lv0wz2axhnvpk4zqkxhap5q1793x0n6l-graphics-drivers/in the same phase, we get the same result.The permissions seem fine, and we can access other /nix/store paths without issues...
Things to try
programs.nix-required-mounts.allowedPatterns.nvidia-gpu.unsafeFollowSymlinks = true;programs.nix-required-mounts.allowedPatterns.nvidia-gpu.paths = [ "/run/opengl-driver/*" ];programs.nix-required-mounts.allowedPatterns.nvidia-gpu.pathswith/run/opengl-driver/{lib,bin,include...}More packages can be added to
config.hardware.graphics.extraPackagesorconfig.programs.nix-required-mounts.allowedPatterns.nvidia-gpu.pathsto be available in the sandbox. Currently:The
/nix/store/lv0wz2axhnvpk4zqkxhap5q1793x0n6l-graphics-drivers/derivation seems to be the output of joinSymlink with several graphics packages. We can find out where it is and add it to the list, but probably settingunsafeFollowSymlinkswould do it.This patch seems to fix it:
There is no easy way to get the outcome of the buildEnv command...
Fixed in #146