CUDA: Difference between revisions

Smudgebun (talk | contribs)
Enabling CUDA In Packages: Restructured the paragraphs to hopefully be more clear
Smudgebun (talk | contribs)
Enabling CUDA In Packages: Improved the structure and clarity of the section
Line 198: Line 198:
Or you can use binary-packaged versions of CUDA compatible software, such as [https://github.com/edolstra/nix-warez/tree/master/blender blender-bin] for Blender.
Or you can use binary-packaged versions of CUDA compatible software, such as [https://github.com/edolstra/nix-warez/tree/master/blender blender-bin] for Blender.


If you will be using <code>cudaSupport</code> in packages, it is highly recommended you utilize the [[#Setting up CUDA Binary Cache|CUDA Binary Cache]]. Without it, any CUDA compatible package installed with <code>cudaSupport</code> will be compiled from source. This is because NixOS Foundation does not build (and therefore [https://cache.nixos.org/ cache.nixos.org] does not cache) packages with CUDA support enabled due to the license.
{{info|If you will be using <code>cudaSupport</code> in packages, it is highly recommended you utilize the [[#Setting up CUDA Binary Cache|CUDA Binary Cache]].}}


For larger programs like Blender that process can be very resource-intensive. If you know you are installing a large package and do not have the cache configured, it is recommended to limit the number of cores and/or jobs that the process will take, to prevent a crash. This can be done with the <code>--max-jobs</code> / <code>-j</code> and <code>--cores</code> flags, for more details see: [https://github.com/NixOS/nix/blob/master/doc/manual/source/advanced-topics/cores-vs-jobs.md Tuning Cores & Jobs].
Without the CUDA Cache, any CUDA compatible package installed with <code>cudaSupport</code> will be compiled from source. This is because NixOS Foundation does not build (and therefore [https://cache.nixos.org/ cache.nixos.org] does not cache) CUDA packages.


This is also why it is recommended, if you cannot use the cache, to enable <code>cudaSupport</code> only for the programs you need it for, to avoid pointlessly compiling packages from source.
For larger programs like Blender, that process can be very resource-intensive. If you know you are installing a large package and cannot use the cache, it is recommended to reduce the number of cores and/or jobs that the process will take, to prevent a crash from memory limits. This can be done with the <code>--max-jobs</code> / <code>-j</code> and <code>--cores</code> flags, for more details see the [https://github.com/NixOS/nix/blob/master/doc/manual/source/advanced-topics/cores-vs-jobs.md Tuning Cores & Jobs] page.


For specifics on setting up Blender with CUDA see: [[Blender#CUDA & OptiX]].
&rarr; For specifics on setting up Blender with CUDA (and OptiX) see: [[Blender#CUDA & OptiX]].


== Some things to keep in mind when setting up CUDA in NixOS ==
== Some things to keep in mind when setting up CUDA in NixOS ==