Resolves symbolic links for CUDA paths

Resolves #35122.
This commit is contained in:
Jinzhe Zeng 2020-02-24 01:49:07 -05:00
parent 8bb7420492
commit a836864711
2 changed files with 3 additions and 3 deletions

View File

@ -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):

View File

@ -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: