diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl index 9029e76fef5..2730685a26f 100644 --- a/tensorflow/tensorflow.bzl +++ b/tensorflow/tensorflow.bzl @@ -2633,8 +2633,8 @@ def tf_py_build_info_genrule(name, out): "msvcp_dll_names": "msvcp140.dll,msvcp140_1.dll", }), "") + if_windows_cuda(_dict_to_kv({ "nvcuda_dll_name": "nvcuda.dll", - "cudart_dll_name": "cudart64_$$(echo $${TF_CUDA_VERSION:-} | sed \"s/\\.//\").dll", - "cudnn_dll_name": "cudnn64_$${TF_CUDNN_VERSION:-}.dll", + "cudart_dll_name": "cudart{cuda_version}.dll", + "cudnn_dll_name": "cudnn{cudnn_version}.dll", }), ""), ) diff --git a/tensorflow/tools/build_info/gen_build_info.py b/tensorflow/tools/build_info/gen_build_info.py index 964a882874f..19478ab4dc2 100755 --- a/tensorflow/tools/build_info/gen_build_info.py +++ b/tensorflow/tools/build_info/gen_build_info.py @@ -39,6 +39,10 @@ def write_build_info(filename, key_value_list): """ build_info = {} + + if cuda_config: + build_info.update(cuda_config.config) + for arg in key_value_list: key, value = six.ensure_str(arg).split("=") if value.lower() == "true": @@ -46,10 +50,7 @@ def write_build_info(filename, key_value_list): elif value.lower() == "false": build_info[key] = False else: - build_info[key] = value - - if cuda_config: - build_info.update(cuda_config.config) + build_info[key] = value.format(**build_info) contents = """ # Copyright 2020 The TensorFlow Authors. All Rights Reserved.