fix build due to cupti static link.

PiperOrigin-RevId: 313880914
Change-Id: I4cf691e60fd28e773f124e440ebb30f054d5f2e9
This commit is contained in:
A. Unique TensorFlower 2020-05-29 17:40:27 -07:00 committed by TensorFlower Gardener
parent 00f027a374
commit 396105ddd5
2 changed files with 8 additions and 0 deletions

View File

@ -98,11 +98,18 @@ tf_cuda_library(
] + tf_additional_cupti_deps(), ] + tf_additional_cupti_deps(),
) )
# Rationale for linkstatic: The symbols in libcupti_static.a have hidden
# visibility. The wrapper will fail to find them if it's ever built as a
# shared library. This is the same issue as b/11094727. Always linking
# the wrapper statically works around the issue. An alternative would be
# to patch libcupti_static, but it's not worth the trouble considering
# that the wrapper is about the only direct user.
tf_cuda_library( tf_cuda_library(
name = "cupti_wrapper", name = "cupti_wrapper",
srcs = if_cuda_is_configured_compat(["cupti_wrapper.cc"]), srcs = if_cuda_is_configured_compat(["cupti_wrapper.cc"]),
hdrs = if_cuda_is_configured_compat(["cupti_wrapper.h"]), hdrs = if_cuda_is_configured_compat(["cupti_wrapper.h"]),
copts = tf_copts(), copts = tf_copts(),
linkstatic = 1,
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
":cupti_interface", ":cupti_interface",

View File

@ -14,6 +14,7 @@ limitations under the License.
==============================================================================*/ ==============================================================================*/
#include "third_party/gpus/cuda/extras/CUPTI/include/cupti.h" #include "third_party/gpus/cuda/extras/CUPTI/include/cupti.h"
#include "third_party/gpus/cuda/include/cuda.h"
// IWYU pragma: no_include "perftools/gputools/executor/stream_executor.h" // IWYU pragma: no_include "perftools/gputools/executor/stream_executor.h"
#include "tensorflow/stream_executor/lib/env.h" #include "tensorflow/stream_executor/lib/env.h"
#include "tensorflow/stream_executor/platform/dso_loader.h" #include "tensorflow/stream_executor/platform/dso_loader.h"