Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions nix-builder/lib/extension/torch/arch.nix
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ let

metalSupport = buildConfig.metal or false;

cpuSupport = buildConfig.cpu or false;

provenanceFlags = import ../provenance-flags.nix { inherit lib kernelProvenance; };

in
Expand Down Expand Up @@ -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 = ''
Expand Down
6 changes: 4 additions & 2 deletions nix-builder/tests/Dockerfile.test-kernel
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading