From e18190d43c97404fd1a89b250b5906f7e50e1f44 Mon Sep 17 00:00:00 2001 From: Cloud Han Date: Wed, 6 Sep 2023 23:16:48 +0800 Subject: [PATCH 1/2] Improve hermeticity for clang --- cuda/private/actions/dlink.bzl | 5 ++--- cuda/runtime/BUILD.local_cuda | 3 ++- cuda/templates/BUILD.local_toolchain_clang | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cuda/private/actions/dlink.bzl b/cuda/private/actions/dlink.bzl index e6702bbe..e176ed15 100644 --- a/cuda/private/actions/dlink.bzl +++ b/cuda/private/actions/dlink.bzl @@ -188,7 +188,7 @@ def _wrapper_device_link( compile_common = cuda_helper.create_common_info( # this is useless cuda_archs_info = common.cuda_archs_info, - headers = [fatbin_h], + headers = [fatbin_h, register_h], defines = [ # Silence warning about including internal header. "__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__", @@ -196,8 +196,7 @@ def _wrapper_device_link( "__NV_EXTRA_INITIALIZATION=", "__NV_EXTRA_FINALIZATION=", ], - # TODO: avoid the hardcode path - includes = common.includes + ["external/local_cuda/cuda/include"], + includes = common.includes, system_includes = common.system_includes, quote_includes = common.quote_includes, # suppress cuda mode as c++ mode diff --git a/cuda/runtime/BUILD.local_cuda b/cuda/runtime/BUILD.local_cuda index 6f5cae4b..9c9acd02 100644 --- a/cuda/runtime/BUILD.local_cuda +++ b/cuda/runtime/BUILD.local_cuda @@ -7,9 +7,10 @@ package( filegroup( name = "compiler_deps", srcs = [ - "cuda/version.txt", ":_cuda_header_files", ] + glob([ + "cuda/version.txt", + "cuda/version.json", "cuda/bin/**", "cuda/lib64/**", "cuda/nvvm/**", diff --git a/cuda/templates/BUILD.local_toolchain_clang b/cuda/templates/BUILD.local_toolchain_clang index 903f6377..1a14a437 100644 --- a/cuda/templates/BUILD.local_toolchain_clang +++ b/cuda/templates/BUILD.local_toolchain_clang @@ -26,6 +26,7 @@ cuda_toolchain_config( cuda_toolchain( name = "clang-local", compiler_executable = "%{clang_path}", + compiler_files = "@local_cuda//:compiler_deps", toolchain_config = ":clang-local-config", ) From 262736264a34454fd4bd1c137fd4137b66b28e8a Mon Sep 17 00:00:00 2001 From: Cloud Han Date: Wed, 6 Sep 2023 23:18:19 +0800 Subject: [PATCH 2/2] Remove --spawn_strategy=local from ci --- .github/workflows/build-tests.yaml | 1 - .github/workflows/integration-tests.yaml | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-tests.yaml b/.github/workflows/build-tests.yaml index 215ee920..9dfc64dd 100644 --- a/.github/workflows/build-tests.yaml +++ b/.github/workflows/build-tests.yaml @@ -55,7 +55,6 @@ jobs: run: | echo "build --config=clang" > $HOME/.bazelrc echo "build:clang --@rules_cuda//cuda:archs=sm_80" >> $HOME/.bazelrc - echo "build:clang --spawn_strategy=local" >> $HOME/.bazelrc - run: bazelisk build @rules_cuda_examples//basic:all - run: bazelisk build @rules_cuda_examples//rdc:all diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index 57a38c97..1ec35f81 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -53,7 +53,7 @@ jobs: echo "build --config=clang" > $HOME/.bazelrc echo "build:clang --cxxopt=--cuda-gpu-arch=sm_80 >> $HOME/.bazelrc" - - run: cd examples && bazelisk build --verbose_failures --spawn_strategy=local --cuda_archs='compute_80,sm_80' @rules_cuda_examples//nccl:perf_binaries + - run: cd examples && bazelisk build --verbose_failures --cuda_archs='compute_80,sm_80' @rules_cuda_examples//nccl:perf_binaries - run: bazelisk shutdown @@ -126,7 +126,7 @@ jobs: echo "build --config=clang" > $HOME/.bazelrc echo "build:clang --cxxopt=--cuda-gpu-arch=sm_80 >> $HOME/.bazelrc" - - run: cd examples && bazelisk build --verbose_failures --spawn_strategy=local --cuda_archs='compute_80,sm_80' @rules_cuda_examples//nccl:perf_binaries + - run: cd examples && bazelisk build --verbose_failures --cuda_archs='compute_80,sm_80' @rules_cuda_examples//nccl:perf_binaries - run: bazelisk shutdown