!eWOErHSaiddIbsUNsJ:nixos.org

NixOS CUDA

290 Members
CUDA packages maintenance and support in nixpkgs | https://github.com/orgs/NixOS/projects/27/ | https://nixos.org/manual/nixpkgs/unstable/#cuda57 Servers

Load older messages


SenderMessageTime
9 Sep 2025
@connorbaker:matrix.orgconnor (he/him)Gaétan had mentioned something about (I think, sorry brain is fuzzy from travel) no recent version of PyTorch, either from being outdated or from the build failing02:10:08
@glepage:matrix.orgGaétan Lepage Yes, I was talking about the nvidia (cudaSupport = true) jobset. I have the impression that I didn't get any cache-hits on these packages recently. 08:28:11
@glepage:matrix.orgGaétan LepageMaybe there is nothing wrong and we simply need to wait for nix-community's hydra to catch up.08:28:39
@hugo:okeso.euHugo

Hello!

I am trying to launch tests that rely on CUDA, following help from Gaétan Lepage yesterday, but I do not succeed.
My host is running nixpkgs 25.05, with a clone of nixpkgs/master in the current directory.

Any idea how to get this to run?

09:36:10
@hugo:okeso.euHugo
nix-build -I nixpkgs=. --arg config '{ allowUnfree = true; cudaSupport = true;}' -A python313Packages.triton.tests.axpy-cuda.gpuCheck
this derivation will be built:
  /nix/store/2m1zkm221qr6ziw2qkbds3r37r57f7xj-test-cuda.drv
building '/nix/store/2m1zkm221qr6ziw2qkbds3r37r57f7xj-test-cuda.drv'...
Traceback (most recent call last):
  File "/nix/store/biwmrywsnh5nvfxg13d319cx65956rvc-tester-cuda/bin/tester-cuda", line 38, in <module>
    x = torch.rand(size, device='cuda')
  File "/nix/store/419qp86g5l617y4pv5m0fgj04rhfnxrp-python3-3.13.6-env/lib/python3.13/site-packages/torch/cuda/__init__.py", line 412, in _lazy_init
    torch._C._cuda_init()
    ~~~~~~~~~~~~~~~~~~~^^
RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx
error: builder for '/nix/store/2m1zkm221qr6ziw2qkbds3r37r57f7xj-test-cuda.drv' failed with exit code 1;
       last 7 log lines:
       > Traceback (most recent call last):
       >   File "/nix/store/biwmrywsnh5nvfxg13d319cx65956rvc-tester-cuda/bin/tester-cuda", line 38, in <module>
       >     x = torch.rand(size, device='cuda')
       >   File "/nix/store/419qp86g5l617y4pv5m0fgj04rhfnxrp-python3-3.13.6-env/lib/python3.13/site-packages/torch/cuda/__init__.py", line 412, in _lazy_init
       >     torch._C._cuda_init()
       >     ~~~~~~~~~~~~~~~~~~~^^
       > RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx
       For full logs, run:
         nix log /nix/store/2m1zkm221qr6ziw2qkbds3r37r57f7xj-test-cuda.drv
 python
Python 3.12.11 (main, Jun  3 2025, 15:41:47) [GCC 14.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True
nix-shell -I nixpkgs=. --arg config '{ allowUnfree = true; cudaSupport = true;}' -p python312Packages.torch

[nix-shell:~/Repos/hoh/nixpkgs]$ python
Python 3.12.11 (main, Jun  3 2025, 15:41:47) [GCC 14.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True
09:36:11
@albertlarsan68:albertlarsan.frAlbert Larsan joined the room.13:31:04
@albertlarsan68:albertlarsan.frAlbert Larsan Hello!
I am packaging the cuda plugin for xmrig.
It supports all the way down to cuda 8, so it is made to use the cuda toolkit.
I am able to make it build with the split packages, but it involves ugly hacks with env vars, as the file /nix/store/vg32acb8vlqyhkhabbgvmralfw0kwhi3-cuda_cudart-12.8.90-dev/include/cuda_runtime.h can't find the crt/host_config.h file.
13:56:49
@aciceri:nixos.devaciceri changed their display name from zrsk to aciceri.15:01:30
@albertlarsan68:albertlarsan.frAlbert LarsanFixed it by using the "root" packages instead of using specific outputs15:33:48
@philipdb:matrix.orgPhiliPdB joined the room.18:44:33
@connorbaker:matrix.orgconnor (he/him) You're trying to run tests which require a GPU in the sandbox. Make sure you've enabled the nix-required-mounts NixOS module option (https://search.nixos.org/options?channel=25.05&show=programs.nix-required-mounts.presets.nvidia-gpu.enable&query=nix-required-mounts) and try again. 23:29:21
@connorbaker:matrix.orgconnor (he/him)Do you have an example of what you were trying to do previously which wasn't working?23:31:08
10 Sep 2025
@ss:someonex.netSomeoneSerge (back on matrix) changed their display name from SomeoneSerge (@nixcon & back on matrix) to SomeoneSerge (back on matrix).00:35:23
@ss:someonex.netSomeoneSerge (back on matrix)softdep issues again?00:43:26
@zowoq:matrix.orgzowoqIt only ever takes a couple of hours for our hydra to catch up. After the latest staging-next merge and subsequent nixos-unstable-small channel bump it took less than five hours for the full rebuild of the cuda jobset.04:06:52
@albertlarsan68:albertlarsan.frAlbert LarsanHere is my first version, before I went ahead and created a PR to add it to upstream nixpkgs: https://git.sr.ht/~albertlarsan68/nur/tree/8fcbc4612bcd097065c5691ca18cbc8f0e0825a0/item/pkgs/xmrig-cuda-mo/default.nix And here is the pr: https://github.com/NixOS/nixpkgs/pull/44149405:59:05
@hugo:okeso.euHugo

Thanks connor (he/him) (UTC+2) .

I can now launch the triton test.

However, when attempting to launch tests on the unstloth library, nix builds Torch for Python313 instead of Python 312.
Torch is not supported on Python 3.13 yet - it still attempts to build however which confuses me.

diff --git a/pkgs/development/python-modules/unsloth/default.nix b/pkgs/development/python-modules/unsloth/default.nix
index 73f94721b5e0..e6473c3bfa1d 100644
--- a/pkgs/development/python-modules/unsloth/default.nix
+++ b/pkgs/development/python-modules/unsloth/default.nix
@@ -27,6 +27,9 @@
   hf-transfer,
   diffusers,
   torchvision,
+
+  # tests
+  cudaPackages,
 }:
 
 buildPythonPackage rec {
@@ -85,6 +88,19 @@ buildPythonPackage rec {
   # NotImplementedError: Unsloth: No NVIDIA GPU found? Unsloth currently only supports GPUs!
   dontUsePythonImportsCheck = true;
 
+  passthru.tests = {
+    import-cuda = cudaPackages.writeGpuTestPython
+      {
+        libraries = ps: [
+          ps.torch
+        ];
+      }
+      ''
+        import unsloth
+        unsloth.test()
+      '';
+  };
+
   meta = {
     description = "Finetune Llama 3.3, DeepSeek-R1 & Reasoning LLMs 2x faster with 70% less memory";
     homepage = "https://github.com/unslothai/unsloth";
nix-build -I nixpkgs=. --arg config '{ allowUnfree = true; cudaSupport = true;}' -A python312Packages.unsloth.tests.import-cuda
07:12:50
@glepage:matrix.orgGaétan LepageWhy shouldn't torch support 3.13?07:15:31
@hugo:okeso.euHugoSorry, tensorflow does not support Python 3.1307:16:41
@hugo:okeso.euHugoHow can I get the passthru tests use the Python interpreter specified ?07:20:59
@ss:someonex.netSomeoneSerge (back on matrix) connor (he/him) (UTC+2): are 7AM (2PM UTC) meetings still OK for you? Would you like to reschedule to a different time? We could have Kevin Mittman join us the next time or other 07:48:33
@ss:someonex.netSomeoneSerge (back on matrix)Oh cool, I wonder if this is the 1st project consuming cuda or torch via meson i nixpkgs07:52:33
@ss:someonex.netSomeoneSerge (back on matrix)AFAIK NVIDIA has never had any objections to ZLUDA, only AMD did07:55:35
@hugo:okeso.euHugo

I managed to launch a test on my package with CUDA enabled, but I get an issue from triton not finding a C compiler. Does that ring a bell to someone ?

RuntimeError: Failed to find C compiler. Please specify via CC environment variable or set triton.knobs.build.impl.

I share my work in progress in a draft PR here: https://github.com/NixOS/nixpkgs/pull/441728

09:59:29
@ss:someonex.netSomeoneSerge (back on matrix)
In reply to @hugo:okeso.eu

I managed to launch a test on my package with CUDA enabled, but I get an issue from triton not finding a C compiler. Does that ring a bell to someone ?

RuntimeError: Failed to find C compiler. Please specify via CC environment variable or set triton.knobs.build.impl.

I share my work in progress in a draft PR here: https://github.com/NixOS/nixpkgs/pull/441728

At the very least we recently stopped early-binding rocm libraries, maybe hard-coded compiler paths went with them. Try giving it a compiler at test time as suggested in the error?
10:05:31
@hugo:okeso.euHugoI (vibe) tried to give it a compiler here in this commit https://github.com/NixOS/nixpkgs/pull/441728/commits/81f7997ca1ca37193f2f26fdbc85c586a92ba6dd but was unsuccessful. Any suggestion how to do that?10:06:58
@matthewcroughan:defenestrate.itmatthewcroughan changed their display name from matthewcroughan @ nixcon to matthewcroughan.15:02:50
@lt1379:matrix.orgLunThat should only impact ROCm unless I messed it up! diff was https://github.com/NixOS/nixpkgs/commit/c74e5ffb6526ac1b4870504921b9ba9362189a1715:52:00
@layus:matrix.orglayus joined the room.18:26:24
@layus:matrix.orglayusIs this team involved in flox/nvidia partnership ? (See https://flox.dev/cuda/) I guess so since the nixos foundation also is, but there is no mention of this team or its amazing work.18:30:16

Show newer messages


Back to Room ListRoom Version: 9