Skip to content

Commit

Permalink
Resolve __noinline__ conflicts between gcc 12/13 libstdc++ and CUDA/H…
Browse files Browse the repository at this point in the history
…IP code
  • Loading branch information
pfxuan committed Mar 6, 2024
1 parent c63c340 commit e99e865
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/hip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
torch-version: [2.2.1] # [1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1]
cuda-version: [11.8.0] # [12.3.1, 12.1.1, 11.8.0, 11.7.1, 11.6.2, 11.5.2,11.4.4, 11.3.1, 11.2.2, 11.1.1, 11.0.3, cpu]
rocm-version: [6.0.2] # [5.4.2, 5.6.1, 5.7.3, 6.0.1, 6.0.2]
llvm-version: [16] # [12, 13, 14, 15, 16]
llvm-version: [15] # [12, 13, 14, 15, 16, 17]
cmake-build-type: [Release] # [Debug, ClangTidy]
env:
CCACHE_DIR: ${{ github.workspace }}/ccache
Expand Down Expand Up @@ -155,7 +155,19 @@ jobs:
source .github/workflows/cuda/${{ runner.os }}-env.sh ${CUDA_VER_SHORT}
export PATH=$PATH:/opt/rocm/bin
clang --version
hipify-clang ./vendor/gsplat/backward.cu ./vendor/gsplat/bindings.cu ./vendor/gsplat/forward.cu --cuda-path=${CUDA_HOME} -I /usr/local/${CUDA_HOME}/include -I ./vendor/gsplat -I /mnt/deps/libtorch/include --print-stats
find /opt/rocm -name __clang_cuda_runtime_wrapper.h
sudo ln -s /opt/rocm/llvm/lib/clang/17.0.0 /opt/rocm/llvm/lib/clang/17
hipify-clang -v ./vendor/gsplat/backward.cu ./vendor/gsplat/bindings.cu ./vendor/gsplat/forward.cu \
--cuda-path=${CUDA_HOME} \
-I /opt/rocm/include \
-I ${CUDA_HOME}/include \
-I ${CUDA_HOME}/targets/x86_64-linux/include \
-I ./vendor/gsplat \
-I /mnt/deps/libtorch/include \
-I /mnt/deps/libtorch/include/torch/csrc/api/include/torch \
--print-stats -- -include ./vendor/gsplat/noinline.h
# -I /usr/lib/llvm-15/lib/clang/15.0.7/include \


- name: Clean Compiler Cache
run: |
Expand Down
5 changes: 5 additions & 0 deletions vendor/gsplat/noinline.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Workaround addressing __noinline__ conflicts between gcc 12/13 libstdc++ and CUDA/HIP code
// https://github.com/llvm/llvm-project/issues/57544
#if defined(__clang__) && defined(__CUDA__)
#undef __noinline__
#endif

0 comments on commit e99e865

Please sign in to comment.