# For all you CUDA users out there

**URL:** https://discourse.nixos.org/t/for-all-you-cuda-users-out-there/45383
**Category:** Help
**Created:** [May 14, 2024, 1:26am UTC](https://discourse.nixos.org/t/for-all-you-cuda-users-out-there/45383 "2024-05-14T01:26:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![rastarr](https://discourse.nixos.org/user_avatar/discourse.nixos.org/rastarr/32/11102_2.png) [@rastarr](https://discourse.nixos.org/u/rastarr)
#### Post date: [May 14, 2024, 1:26am UTC](https://discourse.nixos.org/t/for-all-you-cuda-users-out-there/45383/1 "2024-05-14T01:26:28Z")

</div>

Hi All,

I recently switched from my oldish AMD RX580 to a nVidia RTX3060, purely for CUDA capabilities.  
My first surprise was my system rebuilding itself, due to CUDA being unfree and it took several hours.

OK, all good if that’s what needs to happen.

My next surprise was watching this recent nixOS conference [https://www.youtube.com/watch?v=NrEBdFdZ8kI](https://www.youtube.com/watch?v=NrEBdFdZ8kI) and the take-away snippet for me was -

```auto
nix.settings.substituters = ["https://cuda-maintainers.cachix.org"];

```

Adding that greatly reduced rebuild times due to caching.  
I scoured online and wikis for several days on CUDA and nixOS nvidia and no-where is this mentioned, that I found.

Add this one-liner if you’re system is using CUDA.

---

<div class="post-metadata">

### Author: ![eljamm](https://discourse.nixos.org/user_avatar/discourse.nixos.org/eljamm/32/16466_2.png) [@eljamm](https://discourse.nixos.org/u/eljamm)
#### Post date: [May 14, 2024, 5:01am UTC](https://discourse.nixos.org/t/for-all-you-cuda-users-out-there/45383/2 "2024-05-14T05:01:23Z")

</div>

Thanks for sharing. There is a note on the [CUDA](https://wiki.nixos.org/wiki/CUDA) wiki page, but I honestly missed it as well the first time I read that:

> **Cache** : Using the [cuda-maintainers cache](https://app.cachix.org/cache/cuda-maintainers#pull) is recommended! It will save you valuable time and electrons. Getting set up should be as simple as `cachix use cuda-maintainers`.

I don’t know if this is done automatically, but you should probably add the trusted key from the [cuda-maintainers cachix](https://app.cachix.org/cache/cuda-maintainers) as well, like the [Binary Cache](https://wiki.nixos.org/wiki/Binary_Cache#Using_a_binary_cache) wiki page instructs:

```nix
  nix.settings = {
    substituters = [
      "https://cuda-maintainers.cachix.org"
    ];
    trusted-public-keys = [
      "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
    ];
  };

```

Do note that your system needs to build at least once after you add this before it starts using the cache.

---

<div class="post-metadata">

### Author: ![rastarr](https://discourse.nixos.org/user_avatar/discourse.nixos.org/rastarr/32/11102_2.png) [@rastarr](https://discourse.nixos.org/u/rastarr)
#### Post date: [May 14, 2024, 7:16am UTC](https://discourse.nixos.org/t/for-all-you-cuda-users-out-there/45383/3 "2024-05-14T07:16:52Z")

</div>

Ahh thanks @eljamm for updating this, much appreciated.  
And I certainly did miss the cache mention on the CUDA wiki page - in my opinion, it should be a clear code block, for others.

As a new NVIDIA user, any and all tips and tricks are most welcome.  
Thanks again

---

<div class="post-metadata">

### Author: ![eljamm](https://discourse.nixos.org/user_avatar/discourse.nixos.org/eljamm/32/16466_2.png) [@eljamm](https://discourse.nixos.org/u/eljamm)
#### Post date: [May 14, 2024, 8:53am UTC](https://discourse.nixos.org/t/for-all-you-cuda-users-out-there/45383/4 "2024-05-14T08:53:57Z")

</div>

I edited the Wiki and changed the note to a `tip` block. I also added a [section](https://wiki.nixos.org/wiki/CUDA#Setting_up_CUDA_Binary_Cache) for setting the cache up.

Hopefully this makes everything clearer.

---

<div class="post-metadata">

### Author: ![rastarr](https://discourse.nixos.org/user_avatar/discourse.nixos.org/rastarr/32/11102_2.png) [@rastarr](https://discourse.nixos.org/u/rastarr)
#### Post date: [May 14, 2024, 12:26pm UTC](https://discourse.nixos.org/t/for-all-you-cuda-users-out-there/45383/5 "2024-05-14T12:26:05Z")

</div>

great work and thanks for the wiki changes. hopefully this will help others to save their electrons 👍🙏
