!eWOErHSaiddIbsUNsJ:nixos.org

NixOS CUDA

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

You have reached the beginning of time (for this room).


SenderMessageTime
28 Aug 2024
@gmacon:matrix.org@gmacon:matrix.org
In reply to @gmacon:matrix.org

I'm trying to build the Rust candle-kernels crate within Nix, and nvcc is complaining that gcc is too new. I have gcc 13.2.0 and nvcc version 12.2.140 from nixpkgs-24.05-darwin bb8bdb47b718645b2f198a6cf9dff98d967d0fd4.

  /nix/store/r45hzi56bzljzfvh6rgdnjbisy9pxqnj-cuda-merged-12.2/include/crt/host_config.h:143:2: error: #error -- unsupported GNU version! gcc versions later than 12 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.
        |  ^~~~~
  thread 'main' panicked at /home/gmacon3/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen_cuda-0.1.5/src/lib.rs:391:13:
  nvcc error while compiling "src/affine.cu":

  # CLI "nvcc" "--gpu-architecture=sm_90" "--ptx" "--default-stream" "per-thread" "--output-directory" "$PWD/target/debug/build/candle-kernels-809f3e0b9ee8b48d/out" "-Isrc" "-I/nix/store/r45hzi56bzljzfvh6rgdnjbisy9pxqnj-cuda-merged-12.2/include" "src/affine.cu" 

Have other folks seen this? What's the best approach to resolve this?

It turs out that Crane (which is the library I'm using to handle the Rust build) supports a stdenv argument to override the compilers used for the Rust build, so setting it to an older GCC worked.
18:55:04
@ss:someonex.netSomeoneSerge (matrix works sometimes)

older gcc

Note that if you're building a shared library you're going to run into libc issues if you just use gcc12Stdenv. THat's why we have cudaPackages.backendStdenv

21:48:12
29 Aug 2024
@gmacon:matrix.org@gmacon:matrix.org
In reply to @ss:someonex.net

older gcc

Note that if you're building a shared library you're going to run into libc issues if you just use gcc12Stdenv. THat's why we have cudaPackages.backendStdenv

Since this is a Rust project, I'm not building any shared libraries, but this is good to know. Thanks!
13:06:40
@ss:someonex.netSomeoneSerge (matrix works sometimes)
In reply to @gmacon:matrix.org
Since this is a Rust project, I'm not building any shared libraries, but this is good to know. Thanks!
(also relevant if you're loading other shared libraries, e.g. as plugins)
13:10:42

Show newer messages


Back to Room ListRoom Version: 9