CUDA: Difference between revisions

Eljamm (talk | contribs)
Razushi (talk | contribs)
→‎cudatoolkit, cudnn, and related packages: Updated broken links to cuDNN and cuTENSOR, please verify. Update date refers to the last verification, not example updates.
 
(2 intermediate revisions by 2 users not shown)
Line 10: Line 10:


Several "CUDA-X" libraries are packages as well. In particular,
Several "CUDA-X" libraries are packages as well. In particular,
* cuDNN is packaged [https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/science/math/cudnn/generic.nix here].
* cuDNN is packaged [https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/cuda-modules/cudnn here].
* cuTENSOR is packaged [https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/science/math/cutensor/generic.nix here].
* cuTENSOR is packaged [https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/cuda-modules/cutensor here].


{{warning|1=Note that these examples haven't been updated in a while (as of 2022-03-12). May not be the best solution. A better resource is likely the packaging CUDA sample code [https://github.com/NixOS/nixpkgs/blob/master/pkgs/test/cuda/cuda-library-samples/generic.nix here].}}
{{warning|1=Note that these examples have been updated more recently (as of 2024-07-30). May not be the best solution. A better resource is likely the packaging CUDA sample code [https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/cuda-modules/cuda-library-samples/generic.nix here].}}


There are some possible ways to setup a development environment using CUDA on NixOS. This can be accomplished in the following ways:
There are some possible ways to setup a development environment using CUDA on NixOS. This can be accomplished in the following ways:
Line 82: Line 82:


== Setting up CUDA Binary Cache ==
== Setting up CUDA Binary Cache ==
The [https://app.cachix.org/cache/cuda-maintainers cuda-maintainers] cache contains pre-built CUDA packages. By adding it to your system, Nix will fetch these packages instead of building them, saving valuable time and processing power.


For more information, refer to the [[Binary Cache#Using a binary cache Using a binary cache|Using a binary cache]] page.
For more information, refer to the [[Binary Cache#Using a binary cache Using a binary cache|Using a binary cache]] page.
Line 89: Line 91:
=== NixOS ===
=== NixOS ===


Add the [https://app.cachix.org/cache/cuda-maintainers cuda-maintainers] cache to <code>substituters</code> and <code>trusted-public-keys</code> inside your configuration:
Add the cache to <code>substituters</code> and <code>trusted-public-keys</code> inside your system configuration:


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>