

fix: cuda not working on nixos
@5c0549f6a79ee0bc7166a346f918408ae59c0561
--- flake.nix
+++ flake.nix
... | ... | @@ -28,11 +28,25 @@ |
28 | 28 |
rsync |
29 | 29 |
websocat |
30 | 30 |
uv |
31 |
+ cudaPackages_12.cudnn_8_9 |
|
31 | 32 |
]; |
33 |
+ |
|
34 |
+ # https://github.com/NixOS/nixpkgs/issues/278976#issuecomment-1879685177 |
|
35 |
+ # NOTE: Without adding `/run/...` the following error occurs |
|
36 |
+ # RuntimeError: CUDA failed with error CUDA driver version is insufficient for CUDA runtime version |
|
37 |
+ # |
|
38 |
+ # NOTE: sometimes it still doesn't work but rebooting the system fixes it |
|
39 |
+ LD_LIBRARY_PATH = "/run/opengl-driver/lib:${ |
|
40 |
+ pkgs.lib.makeLibraryPath [ |
|
41 |
+ pkgs.cudaPackages_12.cudnn_8_9 |
|
42 |
+ pkgs.zlib |
|
43 |
+ pkgs.stdenv.cc.cc |
|
44 |
+ pkgs.openssl |
|
45 |
+ ] |
|
46 |
+ }"; |
|
47 |
+ |
|
32 | 48 |
shellHook = '' |
33 | 49 |
source .venv/bin/activate |
34 |
- export LD_LIBRARY_PATH=${pkgs.stdenv.cc.cc.lib}/lib:$LD_LIBRARY_PATH |
|
35 |
- export LD_LIBRARY_PATH=${pkgs.zlib}/lib:$LD_LIBRARY_PATH |
|
36 | 50 |
source .env |
37 | 51 |
''; |
38 | 52 |
}; |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?