From c91a951eb8501ccd205c5c7bf3ce238b9f8142e2 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 4 Feb 2026 10:03:46 +0100 Subject: [PATCH] Update CUDA instructions in fox Ask users to clone the repository with the development shells instead, so we can keep the repository easily updated. --- content/fox/_index.md | 69 ++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 43 deletions(-) diff --git a/content/fox/_index.md b/content/fox/_index.md index dedb9e1..c5ea9ba 100644 --- a/content/fox/_index.md +++ b/content/fox/_index.md @@ -46,55 +46,38 @@ Follow [these steps](/access) if you don't have access to apex or fox. ## CUDA -To use CUDA, you can use the following `flake.nix` placed in a new directory to -load all the required dependencies: +To use CUDA you'll need to load the NVIDIA `nvcc` compiler and some additional +libraries in the environment. Clone the +[following +example](https://jungle.bsc.es/git/rarias/devshell/src/branch/main/cuda) and +modify the `flake.nix` if needed to add additional packages. -```nix -{ - inputs.jungle.url = "jungle"; +Then just run `nix develop` from the same directory to spawn a new shell with +the CUDA environment: - outputs = { jungle, ... }: { - devShell.x86_64-linux = let - pkgs = jungle.nixosConfigurations.fox.pkgs; - in pkgs.mkShell { - name = "cuda-env-shell"; - buildInputs = with pkgs; [ - git gitRepo gnupg autoconf curl - procps gnumake util-linux m4 gperf unzip + fox% git clone https://jungle.bsc.es/git/rarias/devshell - # Cuda packages (more at https://search.nixos.org/packages) - cudatoolkit linuxPackages.nvidia_x11 - cudaPackages.cuda_cudart.static - cudaPackages.libcusparse + fox% cd devshell/cuda - libGLU libGL - xorg.libXi xorg.libXmu freeglut - xorg.libXext xorg.libX11 xorg.libXv xorg.libXrandr zlib - ncurses5 stdenv.cc binutils - ]; - shellHook = '' - export CUDA_PATH=${pkgs.cudatoolkit} - export LD_LIBRARY_PATH=/var/run/opengl-driver/lib - export SMS=50 - ''; - }; - }; -} -``` + fox% nix develop -Then just run `nix develop` from the same directory: - - % mkdir cuda - % cd cuda - % vim flake.nix - [...] - % nix develop - $ nvcc -V + fox$ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver - Copyright (c) 2005-2024 NVIDIA Corporation - Built on Tue_Feb_27_16:19:38_PST_2024 - Cuda compilation tools, release 12.4, V12.4.99 - Build cuda_12.4.r12.4/compiler.33961263_0 + Copyright (c) 2005-2025 NVIDIA Corporation + Built on Fri_Feb_21_20:23:50_PST_2025 + Cuda compilation tools, release 12.8, V12.8.93 + Build cuda_12.8.r12.8/compiler.35583870_0 + + fox$ make + nvcc -ccbin g++ -m64 -Wno-deprecated-gpu-targets -o cudainfo cudainfo.cpp + + fox$ ./cudainfo + ./cudainfo Starting... + + CUDA Device Query (Runtime API) version (CUDART static linking) + + Detected 2 CUDA Capable device(s) + ... ## AMD uProf