Skip to content

Add ROCm-compatible CUDA source fixes#4

Open
ZJLi2013 wants to merge 1 commit into
rmurai0610:mainfrom
PhysicalAI-AIM:rocm_support
Open

Add ROCm-compatible CUDA source fixes#4
ZJLi2013 wants to merge 1 commit into
rmurai0610:mainfrom
PhysicalAI-AIM:rocm_support

Conversation

@ZJLi2013

Copy link
Copy Markdown

Summary

This PR applies small compatibility fixes to the existing CUDA rasterizer sources so the extension can build under PyTorch ROCm/hipify. It only modifies original source files and does not add generated HIP sources.

Changes

  • Remove CUDA-only headers that are unavailable in the ROCm toolchain.
  • Normalize CUDA kernel launch syntax so hipify can parse the existing .cu sources.
  • Replace CUDA-only trap / pointer type usage with forms accepted by ROCm hipcc.
  • Avoid vector operator overload issues in reduction helpers.
  • Rewrite vector smoothstep helpers using scalar component-wise calls that compile under hipcc.

Reproduction

git clone https://github.com/ZJLi2013/diff-gaussian-rasterization-w-pose.git
cd diff-gaussian-rasterization-w-pose
git checkout rocm_support
git submodule update --init --recursive

export PYTORCH_ROCM_ARCH=gfx942
pip install . --no-build-isolation

python - <<'PY'
import torch
import diff_gaussian_rasterization
print(torch.__version__, torch.version.hip)
print("diff_gaussian_rasterization import ok")
PY

Tested On

  • GPU: AMD Instinct MI300X
  • ROCm: 6.4.3
  • PyTorch: 2.6.0 ROCm Docker build
  • Docker: rocm/pytorch:rocm6.4.3_ubuntu24.04_py3.12_pytorch_release_2.6.0

Notes

  • CUDA builds still use the existing cuda_rasterizer/*.cu source path.
  • This PR intentionally avoids checking in generated HIP sources.

Remove CUDA-only includes and adjust small source incompatibilities so the extension can build under PyTorch ROCm hipify.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant