From a83686471143b3f3234f23637c85c6b0cab3c3ef Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Mon, 24 Feb 2020 01:49:07 -0500 Subject: [PATCH] Resolves symbolic links for CUDA paths Resolves #35122. --- third_party/gpus/cuda_configure.bzl | 4 ++-- third_party/gpus/find_cuda_config.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/third_party/gpus/cuda_configure.bzl b/third_party/gpus/cuda_configure.bzl index bdaaa4ab250..c7bc350959a 100644 --- a/third_party/gpus/cuda_configure.bzl +++ b/third_party/gpus/cuda_configure.bzl @@ -360,8 +360,8 @@ def _cuda_include_path(repository_ctx, cuda_config): ) inc_entries = [] if target_dir != "": - inc_entries.append(target_dir) - inc_entries.append(cuda_config.cuda_toolkit_path + "/include") + inc_entries.append(str(repository_ctx.path(target_dir).realpath)) + inc_entries.append(str(repository_ctx.path(cuda_config.cuda_toolkit_path + "/include").realpath)) return inc_entries def enable_cuda(repository_ctx): diff --git a/third_party/gpus/find_cuda_config.py b/third_party/gpus/find_cuda_config.py index 39f2c21d3fb..57067b35629 100644 --- a/third_party/gpus/find_cuda_config.py +++ b/third_party/gpus/find_cuda_config.py @@ -449,7 +449,7 @@ def find_cuda_config(): cuda_version = os.environ.get("TF_CUDA_VERSION", "") base_paths = _list_from_env("TF_CUDA_PATHS", _get_default_cuda_paths(cuda_version)) - base_paths = [path for path in base_paths if os.path.exists(path)] + base_paths = [os.path.realpath(path) for path in base_paths if os.path.exists(path)] result = {} if "cuda" in libraries: