Skip to content

Commit 61364d6

Browse files
committed
Add build-only ROCm CI job
The CUDA CI job has been failing on every push to main since at least 2026-02-23 with an unrelated gcc-13/CUDA-12.1 compiler-version mismatch — pre-existing breakage, not introduced by this PR. The Scheduled workflow (different toolchain pin) still passes on main, which is how releases get cut. This commit adds a parallel `linux_rocm_build` job that catches build regressions in the ROCm/HIP code paths added by this PR (USE_ROCM guards, hipify-touched sources, the pulsar `_rn`/`atomicAdd_block` intrinsic replacements). It runs inside the official `rocm/dev-ubuntu-22.04:6.2.4` container on a CPU-only `ubuntu-latest` runner: AMD GPU hardware isn't required to *compile* against ROCm, only to run tests, so we skip test execution and keep CI minutes low. The container ships hipcc plus the ROCm SDK at /opt/rocm (auto-detected as ROCM_HOME). We pip-install torch==2.4.1 from the rocm6.2 wheel index, verify torch.version.hip is set, then `pip install -e .` with FORCE_CUDA=1 (the runner has no GPU, so torch.cuda.is_available() is False and FORCE_CUDA flips the CUDAExtension branch on). A final smoke import confirms `_C.PulsarRenderer` linked. ROCm 6.2 was chosen because pulsar's port uses `__hip_atomic_fetch_add` with `__HIP_MEMORY_SCOPE_WORKGROUP` and the modern HIP atomic API, which is stable in 6.2+ (matches the TODO comment that Suresh Babu Kolla left at pulsar/gpu/commands.h:63 referencing ROCM-6.2 as the minimum target). The CUDA job is left unchanged. Co-Authored-By: Claude Opus 4.7 (1M context)
1 parent eea2762 commit 61364d6

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,38 @@ jobs:
2121
run: |-
2222
conda create --name env --yes --quiet conda-build
2323
conda run --no-capture-output --name env python3 ./packaging/build_conda.py --use-conda-cuda
24+
25+
# Build-only verification for the ROCm/HIP code paths. Runs in an AMD ROCm
26+
# dev container on a CPU-only GitHub runner; we don't need an AMD GPU just
27+
# to compile, and not running tests keeps the CI cost low. Catches build
28+
# regressions in the ROCm code paths (USE_ROCM guards, hipify-touched sources,
29+
# the pulsar HIP intrinsic replacements, etc.).
30+
linux_rocm_build:
31+
runs-on: ubuntu-latest
32+
container:
33+
image: rocm/dev-ubuntu-22.04:6.2.4
34+
env:
35+
PYTORCH_VERSION: "2.4.1"
36+
ROCM_INDEX: "rocm6.2"
37+
steps:
38+
- uses: actions/checkout@v4
39+
- name: Install Python and torch+rocm
40+
run: |-
41+
apt-get update
42+
apt-get install -y --no-install-recommends python3 python3-dev python3-pip git
43+
python3 -m pip install --upgrade pip
44+
python3 -m pip install --index-url https://download.pytorch.org/whl/${ROCM_INDEX} torch==${PYTORCH_VERSION}
45+
- name: Verify torch is ROCm-built
46+
run: |-
47+
python3 -c "import torch; assert torch.version.hip is not None, 'torch is not HIP-built'; print('torch.version.hip:', torch.version.hip)"
48+
- name: Build pytorch3d _C extension (build only, no tests)
49+
env:
50+
# CPU-only runner: torch.cuda.is_available() is False, so force the
51+
# CUDAExtension path. ROCM_HOME is auto-detected from /opt/rocm in
52+
# the rocm/dev-ubuntu container.
53+
FORCE_CUDA: "1"
54+
run: |-
55+
python3 -m pip install --no-build-isolation -v -e .
56+
- name: Smoke import
57+
run: |-
58+
python3 -c "from pytorch3d import _C; print('PulsarRenderer:', hasattr(_C, 'PulsarRenderer')); print('n_symbols:', len([s for s in dir(_C) if not s.startswith('_')]))"

0 commit comments

Comments
 (0)