I found a solution for this issue. Here’s how I addressed it:
- Cachix Setup:
- I used Cachix not to compile/build CUDA.
- Also, I used package
pytorch-bin
in my nix-shell file.
- Nix-Shell Configuration:
- I did not use
cudaSupport = true;
in thenix-shell
file. Including this option would compile CUDA, which is unnecessary in this case. - The same issue occurred with the
torchWithCuda
package (or similar).
- Cachix Installation:
- When installing, Cachix will generate a new
caching.nix
file and acaching
directory in/etc/nixos
. Make sure to move these to your dotfiles. - After installing Cachix, you’ll need to import it into your
configuration.nix
file and do nixos-rebuild.
After all this steps I successfully was able to run nix-shell shell.nix and had cuda available in pytorch
Hope this helps someone, I might also post here my shell.nix later on.
Useful links:
https://nixos.wiki/wiki/CUDA