diff --git a/nix-builder/lib/extension/torch/arch.nix b/nix-builder/lib/extension/torch/arch.nix index e9fbb322..e37ef6a8 100644 --- a/nix-builder/lib/extension/torch/arch.nix +++ b/nix-builder/lib/extension/torch/arch.nix @@ -123,6 +123,8 @@ let metalSupport = buildConfig.metal or false; + cpuSupport = buildConfig.cpu or false; + provenanceFlags = import ../provenance-flags.nix { inherit lib kernelProvenance; }; in @@ -281,17 +283,26 @@ stdenv.mkDerivation (prevAttrs: { ] ++ lib.optionals cudaSupport [ (lib.cmakeFeature "CMAKE_CUDA_HOST_COMPILER" "${stdenv.cc}/bin/g++") + (lib.cmakeFeature "GPU_LANG" "CUDA") ] ++ lib.optionals rocmSupport [ # Ensure sure that we use HIP from our CLR override and not HIP from # the symlink-joined ROCm toolkit. (lib.cmakeFeature "CMAKE_HIP_COMPILER_ROCM_ROOT" "${clr}") (lib.cmakeFeature "HIP_ROOT_DIR" "${clr}") + (lib.cmakeFeature "GPU_LANG" "HIP") ] ++ lib.optionals metalSupport [ # Use host compiler for Metal. Not included in the redistributable SDK. # Re-enable when the issue mentioned in preConfigure is solved. #(lib.cmakeFeature "METAL_COMPILER" "${xcrunHost}/bin/xcrunHost") + (lib.cmakeFeature "GPU_LANG" "METAL") + ] + ++ lib.optionals xpuSupport [ + (lib.cmakeFeature "GPU_LANG" "SYCL") + ] + ++ lib.optionals cpuSupport [ + (lib.cmakeFeature "GPU_LANG" "CPU") ]; postInstall = '' diff --git a/nix-builder/tests/Dockerfile.test-kernel b/nix-builder/tests/Dockerfile.test-kernel index d53c8668..1ce2a5bd 100644 --- a/nix-builder/tests/Dockerfile.test-kernel +++ b/nix-builder/tests/Dockerfile.test-kernel @@ -15,8 +15,10 @@ ENV DEBIAN_FRONTEND=noninteractive \ NVIDIA_DRIVER_CAPABILITIES=compute,utility # Install uv and Rust toolchain (Rust is needed to build kernels from source, which -# bundles a maturin/pyo3 extension module). -RUN dnf install -y --allowerasing curl && \ +# bundles a maturin/pyo3 extension module). We disable the CUDA repo, because we +# don't need it for curl and it reduces the chance of transient errors when +# installing. +RUN dnf install -y --allowerasing --disablerepo=cuda curl && \ curl -LsSf https://astral.sh/uv/install.sh | sh && \ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ dnf clean all