When building NCCL from source, do not rely on CUDA_TOOLKIT_PATH being defined to find bin2c.
PiperOrigin-RevId: 219698198
This commit is contained in:
parent
f0dbcffb0e
commit
456e6927c0
third_party/nccl
7
third_party/nccl/build_defs.bzl.tpl
vendored
7
third_party/nccl/build_defs.bzl.tpl
vendored
@ -182,8 +182,9 @@ def device_link(name, srcs):
|
|||||||
# Generate fatbin header from all cubins.
|
# Generate fatbin header from all cubins.
|
||||||
fatbin_hdr = name + ".fatbin.h"
|
fatbin_hdr = name + ".fatbin.h"
|
||||||
fatbinary = "@local_config_nccl//:cuda/bin/fatbinary"
|
fatbinary = "@local_config_nccl//:cuda/bin/fatbinary"
|
||||||
cmd = ("PATH=$$CUDA_TOOLKIT_PATH/bin:$$PATH " + # for bin2c
|
bin2c = "@local_config_nccl//:cuda/bin/bin2c"
|
||||||
"$(location %s) -64 --cmdline=--compile-only --link " % fatbinary +
|
cmd = ("$(location %s) -64 --cmdline=--compile-only " % fatbinary +
|
||||||
|
"--link --bin2c-path $$(dirname $(location %s)) " % bin2c +
|
||||||
"--compress-all %s --create=%%{name}.fatbin " % " ".join(images) +
|
"--compress-all %s --create=%%{name}.fatbin " % " ".join(images) +
|
||||||
"--embedded-fatbin=$@")
|
"--embedded-fatbin=$@")
|
||||||
native.genrule(
|
native.genrule(
|
||||||
@ -191,7 +192,7 @@ def device_link(name, srcs):
|
|||||||
outs = [fatbin_hdr],
|
outs = [fatbin_hdr],
|
||||||
srcs = cubins,
|
srcs = cubins,
|
||||||
cmd = cmd,
|
cmd = cmd,
|
||||||
tools = [fatbinary],
|
tools = [fatbinary, bin2c],
|
||||||
)
|
)
|
||||||
|
|
||||||
# Generate the source file #including the headers generated above.
|
# Generate the source file #including the headers generated above.
|
||||||
|
3
third_party/nccl/nccl_configure.bzl
vendored
3
third_party/nccl/nccl_configure.bzl
vendored
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
`nccl_configure` depends on the following environment variables:
|
`nccl_configure` depends on the following environment variables:
|
||||||
|
|
||||||
* `TF_NCCL_VERSION`: The NCCL version.
|
* `TF_NCCL_VERSION`: Installed NCCL version or empty to build from source.
|
||||||
* `NCCL_INSTALL_PATH`: The installation path of the NCCL library.
|
* `NCCL_INSTALL_PATH`: The installation path of the NCCL library.
|
||||||
* `NCCL_HDR_PATH`: The installation path of the NCCL header files.
|
* `NCCL_HDR_PATH`: The installation path of the NCCL header files.
|
||||||
"""
|
"""
|
||||||
@ -44,6 +44,7 @@ _NCCL_ARCHIVE_BUILD_CONTENT = """
|
|||||||
exports_files([
|
exports_files([
|
||||||
"cuda/bin/crt/link.stub",
|
"cuda/bin/crt/link.stub",
|
||||||
"cuda/bin/fatbinary",
|
"cuda/bin/fatbinary",
|
||||||
|
"cuda/bin/bin2c",
|
||||||
"nvlink",
|
"nvlink",
|
||||||
])
|
])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user