Use CUDA tools from @local_config_cuda when building NCCL.

PiperOrigin-RevId: 230245994
This commit is contained in:
A. Unique TensorFlower 2019-01-21 11:45:07 -08:00 committed by TensorFlower Gardener
parent dad786f963
commit ff91cd6910
2 changed files with 4 additions and 20 deletions

View File

@ -202,25 +202,25 @@ _device_link = rule(
"gpu_archs": attr.string_list(),
"nvlink_args": attr.string_list(),
"_nvlink": attr.label(
default = Label("@local_config_nccl//:nvlink"),
default = Label("@local_config_cuda//cuda:cuda/bin/nvlink"),
allow_single_file = True,
executable = True,
cfg = "host",
),
"_fatbinary": attr.label(
default = Label("@local_config_nccl//:cuda/bin/fatbinary"),
default = Label("@local_config_cuda//cuda:cuda/bin/fatbinary"),
allow_single_file = True,
executable = True,
cfg = "host",
),
"_bin2c": attr.label(
default = Label("@local_config_nccl//:cuda/bin/bin2c"),
default = Label("@local_config_cuda//cuda:cuda/bin/bin2c"),
allow_single_file = True,
executable = True,
cfg = "host",
),
"_link_stub": attr.label(
default = Label("@local_config_nccl//:cuda/bin/crt/link.stub"),
default = Label("@local_config_cuda//cuda:cuda/bin/crt/link.stub"),
allow_single_file = True,
),
},

View File

@ -43,13 +43,6 @@ cc_library(
"""
_NCCL_ARCHIVE_BUILD_CONTENT = """
exports_files([
"cuda/bin/crt/link.stub",
"cuda/bin/fatbinary",
"cuda/bin/bin2c",
"nvlink",
])
filegroup(
name = "LICENSE",
data = ["@nccl_archive//:LICENSE.txt"],
@ -151,15 +144,6 @@ def _nccl_configure_impl(repository_ctx):
repository_ctx.template("build_defs.bzl", _label("build_defs.bzl.tpl"), {
"%{gpu_architectures}": str(gpu_architectures),
})
repository_ctx.symlink(cuda_toolkit_path(repository_ctx), "cuda")
# Temporary work-around for setups which symlink ptxas to a newer
# version. The versions of nvlink and ptxas need to agree, so we find
# nvlink next to the real location of ptxas. This is only temporary and
# will be removed again soon.
nvlink_dir = repository_ctx.path("cuda/bin/ptxas").realpath.dirname
repository_ctx.symlink(nvlink_dir.get_child("nvlink"), "nvlink")
else:
# Create target for locally installed NCCL.
nccl_install_path = repository_ctx.os.environ[_NCCL_INSTALL_PATH].strip()