Skip to content
Merged
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
6 changes: 4 additions & 2 deletions ci/scripts/package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ and `[tool.scikit-build]`). This directory holds the few helper scripts that flo
invokes:

- `manylinux_build_libtvm_runtime_cuda.sh` — run by the `build_cuda_runtime` CI
stage; builds the `libtvm_runtime_cuda.so` sidecar inside the manylinux container.
stage; builds the `libtvm_runtime_cuda.so` sidecar inside the prebuilt
`quay.io/manylinux_cuda` image (CUDA toolkit preinstalled).
- `windows_build_libtvm_runtime_cuda.bat` — the Windows equivalent (run with
`shell: cmd`), building `tvm_runtime_cuda.dll`.
`shell: cmd`); installs the CUDA toolkit via conda and builds
`tvm_runtime_cuda.dll`.
- `build-environment.yaml` — conda environment for building the wheel.
8 changes: 4 additions & 4 deletions ci/scripts/package/manylinux_build_libtvm_runtime_cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ set -euxo pipefail

repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
build_dir="${repo_root}/build-wheel-cuda"
python_bin="/opt/python/cp310-cp310/bin/python"
parallel="$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 4)"

# Build the CUDA runtime sidecar with CUDA on and LLVM off, so it does not need
# the LLVM prefix; the main CPU wheel links LLVM statically. pip-install
# cmake/ninja rather than relying on whatever the image ships.
# the LLVM prefix; the main CPU wheel links LLVM statically. The manylinux CUDA
# image already ships cmake and make, and the build uses the default Makefiles
# generator (no Ninja), so no build tools are installed here. Put the bundled
# CPython and CUDA toolchain on PATH for the CMake configure and nvcc.
export PATH="/opt/python/cp310-cp310/bin:/usr/local/cuda/bin:${PATH}"
"${python_bin}" -m pip install -U pip cmake ninja
nvcc --version

rm -rf "${build_dir}"
Expand Down
9 changes: 5 additions & 4 deletions ci/scripts/package/windows_build_libtvm_runtime_cuda.bat
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ set "conda_exe=conda"
where conda >nul 2>nul || set "conda_exe=%CONDA%\Scripts\conda.exe"

rem Install the pinned CUDA toolkit via conda from the nvidia channel, mirroring the
rem LLVM-via-conda install used elsewhere. The win-64 channel caps at 13.0.x, matching
rem the Linux hook's CUDA 13.0.2. The nvidia CDN occasionally returns a transient
rem HTTP 5xx, so retry once; a half-finished first attempt can leave the prefix
rem partially populated, so wipe it before retrying.
rem LLVM-via-conda install used elsewhere. The win-64 channel caps at 13.0.x, so this
rem pins 13.0.2 -- slightly behind the Linux image's CUDA 13.1, which is harmless: the
rem sidecar has no device code and links the CUDA runtime by soname only. The nvidia
rem CDN occasionally returns a transient HTTP 5xx, so retry once; a half-finished first
rem attempt can leave the prefix partially populated, so wipe it before retrying.
if not exist "%cuda_prefix%\Library\bin\nvcc.exe" (
call "%conda_exe%" create -q -p "%cuda_prefix%" -c nvidia/label/cuda-13.0.2 cuda-toolkit -y
if errorlevel 1 (
Expand Down
Loading