6
6
* `TF_CUDA_CLANG`: Whether to use clang as a cuda compiler.
7
7
* `CLANG_CUDA_COMPILER_PATH`: The clang compiler path that will be used for
8
8
both host and device code compilation if TF_CUDA_CLANG is 1.
9
- * `TF_CUDA_PATHS`: The base paths to look for CUDA and cuDNN . Default is
9
+ * `TF_CUDA_PATHS`: The base paths to look for CUDA. Default is
10
10
`/usr/local/cuda,usr/`.
11
11
* `CUDA_TOOLKIT_PATH`: The path to the CUDA toolkit. Default is
12
12
`/usr/local/cuda`.
13
13
* `TF_CUDA_VERSION`: The version of the CUDA toolkit. If this is blank, then
14
14
use the system default.
15
- * `TF_CUDNN_VERSION`: The version of the cuDNN library.
16
- * `CUDNN_INSTALL_PATH`: The path to the cuDNN library. Default is
17
- `/usr/local/cuda`.
18
15
* `TF_CUDA_COMPUTE_CAPABILITIES`: The CUDA compute capabilities. Default is
19
16
`3.5,5.2`.
20
17
* `PYTHON_BIN_PATH`: The python binary path
@@ -40,10 +37,6 @@ _CUDA_TOOLKIT_PATH = "CUDA_TOOLKIT_PATH"
40
37
41
38
_TF_CUDA_VERSION = "TF_CUDA_VERSION"
42
39
43
- _TF_CUDNN_VERSION = "TF_CUDNN_VERSION"
44
-
45
- _CUDNN_INSTALL_PATH = "CUDNN_INSTALL_PATH"
46
-
47
40
_TF_CUDA_COMPUTE_CAPABILITIES = "TF_CUDA_COMPUTE_CAPABILITIES"
48
41
49
42
_TF_DOWNLOAD_CLANG = "TF_DOWNLOAD_CLANG"
@@ -554,12 +547,12 @@ def _find_cuda_lib(
554
547
basedir ,
555
548
version ,
556
549
static = False ):
557
- """Finds the given CUDA or cuDNN library on the system.
550
+ """Finds the given CUDA library on the system.
558
551
Args:
559
552
lib: The name of the library, such as "cudart"
560
553
repository_ctx: The repository context.
561
554
cpu_value: The name of the host operating system.
562
- basedir: The install directory of CUDA or cuDNN .
555
+ basedir: The install directory of CUDA.
563
556
version: The version of the library.
564
557
static: True if static library, False if shared object.
565
558
Returns:
@@ -581,7 +574,7 @@ def _find_cuda_lib(
581
574
)
582
575
583
576
def _find_libs (repository_ctx , cuda_config ):
584
- """Returns the CUDA and cuDNN libraries on the system.
577
+ """Returns the CUDA libraries on the system.
585
578
Args:
586
579
repository_ctx: The repository context.
587
580
cuda_config: The CUDA config as returned by _get_cuda_config
@@ -641,13 +634,6 @@ def _find_libs(repository_ctx, cuda_config):
641
634
cuda_config .config ["cufft_library_dir" ],
642
635
cuda_config .cufft_version ,
643
636
),
644
- "cudnn" : _find_cuda_lib (
645
- "cudnn" ,
646
- repository_ctx ,
647
- cpu_value ,
648
- cuda_config .config ["cudnn_library_dir" ],
649
- cuda_config .cudnn_version ,
650
- ),
651
637
"cupti" : _find_cuda_lib (
652
638
"cupti" ,
653
639
repository_ctx ,
@@ -668,14 +654,12 @@ def _get_cuda_config(repository_ctx):
668
654
Returns:
669
655
A struct containing the following fields:
670
656
cuda_toolkit_path: The CUDA toolkit installation directory.
671
- cudnn_install_basedir: The cuDNN installation directory.
672
657
cuda_version: The version of CUDA on the system.
673
658
cudart_version: The CUDA runtime version on the system.
674
- cudnn_version: The version of cuDNN on the system.
675
659
compute_capabilities: A list of the system's CUDA compute capabilities.
676
660
cpu_value: The name of the host operating system.
677
661
"""
678
- config = find_cuda_config (repository_ctx , ["cuda" , "cudnn" ])
662
+ config = find_cuda_config (repository_ctx , ["cuda" ])
679
663
cpu_value = get_cpu_value (repository_ctx )
680
664
toolkit_path = config ["cuda_toolkit_path" ]
681
665
@@ -685,7 +669,6 @@ def _get_cuda_config(repository_ctx):
685
669
cuda_minor = cuda_version [1 ]
686
670
687
671
cuda_version = ("64_%s%s" if is_windows else "%s.%s" ) % (cuda_major , cuda_minor )
688
- cudnn_version = ("64_%s" if is_windows else "%s" ) % config ["cudnn_version" ]
689
672
690
673
if int (cuda_major ) >= 11 :
691
674
# The libcudart soname in CUDA 11.x is versioned as 11.0 for backward compatability.
@@ -721,7 +704,6 @@ def _get_cuda_config(repository_ctx):
721
704
cusolver_version = cusolver_version ,
722
705
curand_version = curand_version ,
723
706
cufft_version = cufft_version ,
724
- cudnn_version = cudnn_version ,
725
707
compute_capabilities = compute_capabilities (repository_ctx , cuda_version ),
726
708
cpu_value = cpu_value ,
727
709
config = config ,
@@ -769,7 +751,6 @@ def _create_dummy_repository(repository_ctx):
769
751
"%{cudart_lib}" : lib_name ("cudart" , cpu_value ),
770
752
"%{cublas_lib}" : lib_name ("cublas" , cpu_value ),
771
753
"%{cusolver_lib}" : lib_name ("cusolver" , cpu_value ),
772
- "%{cudnn_lib}" : lib_name ("cudnn" , cpu_value ),
773
754
"%{cufft_lib}" : lib_name ("cufft" , cpu_value ),
774
755
"%{curand_lib}" : lib_name ("curand" , cpu_value ),
775
756
"%{cupti_lib}" : lib_name ("cupti" , cpu_value ),
@@ -782,7 +763,6 @@ def _create_dummy_repository(repository_ctx):
782
763
# tensorflow/core/platform/default/build_config:cuda.
783
764
repository_ctx .file ("cuda/cuda/include/cuda.h" )
784
765
repository_ctx .file ("cuda/cuda/include/cublas.h" )
785
- repository_ctx .file ("cuda/cuda/include/cudnn.h" )
786
766
repository_ctx .file ("cuda/cuda/extras/CUPTI/include/cupti.h" )
787
767
repository_ctx .file ("cuda/cuda/lib/%s" % lib_name ("cuda" , cpu_value ))
788
768
repository_ctx .file ("cuda/cuda/lib/%s" % lib_name ("cudart" , cpu_value ))
@@ -791,7 +771,6 @@ def _create_dummy_repository(repository_ctx):
791
771
)
792
772
repository_ctx .file ("cuda/cuda/lib/%s" % lib_name ("cublas" , cpu_value ))
793
773
repository_ctx .file ("cuda/cuda/lib/%s" % lib_name ("cusolver" , cpu_value ))
794
- repository_ctx .file ("cuda/cuda/lib/%s" % lib_name ("cudnn" , cpu_value ))
795
774
repository_ctx .file ("cuda/cuda/lib/%s" % lib_name ("curand" , cpu_value ))
796
775
repository_ctx .file ("cuda/cuda/lib/%s" % lib_name ("cufft" , cpu_value ))
797
776
repository_ctx .file ("cuda/cuda/lib/%s" % lib_name ("cupti" , cpu_value ))
@@ -896,7 +875,6 @@ def _create_local_cuda_repository(repository_ctx):
896
875
897
876
cuda_include_path = cuda_config .config ["cuda_include_dir" ]
898
877
cublas_include_path = cuda_config .config ["cublas_include_dir" ]
899
- cudnn_header_dir = cuda_config .config ["cudnn_include_dir" ]
900
878
cupti_header_dir = cuda_config .config ["cupti_include_dir" ]
901
879
nvvm_libdevice_dir = cuda_config .config ["nvvm_library_dir" ]
902
880
@@ -957,46 +935,6 @@ def _create_local_cuda_repository(repository_ctx):
957
935
out_dir = "cuda/bin" ,
958
936
))
959
937
960
- # Copy cudnn.h if cuDNN was not installed to CUDA_TOOLKIT_PATH.
961
- included_files = _read_dir (repository_ctx , cuda_include_path )
962
- if not any ([file .endswith ("cudnn.h" ) for file in included_files ]):
963
- cudnn_headers = ["cudnn.h" ]
964
- if cuda_config .cudnn_version .rsplit ("_" , 1 )[- 1 ] >= "9" :
965
- cudnn_headers += [
966
- "cudnn_adv.h" ,
967
- "cudnn_backend.h" ,
968
- "cudnn_cnn.h" ,
969
- "cudnn_graph.h" ,
970
- "cudnn_ops.h" ,
971
- "cudnn_version.h" ,
972
- ]
973
- elif cuda_config .cudnn_version .rsplit ("_" , 1 )[- 1 ] >= "8" :
974
- cudnn_headers += [
975
- "cudnn_backend.h" ,
976
- "cudnn_adv_infer.h" ,
977
- "cudnn_adv_train.h" ,
978
- "cudnn_cnn_infer.h" ,
979
- "cudnn_cnn_train.h" ,
980
- "cudnn_ops_infer.h" ,
981
- "cudnn_ops_train.h" ,
982
- "cudnn_version.h" ,
983
- ]
984
-
985
- cudnn_srcs = []
986
- cudnn_outs = []
987
- for header in cudnn_headers :
988
- cudnn_srcs .append (cudnn_header_dir + "/" + header )
989
- cudnn_outs .append ("cudnn/include/" + header )
990
-
991
- copy_rules .append (make_copy_files_rule (
992
- repository_ctx ,
993
- name = "cudnn-include" ,
994
- srcs = cudnn_srcs ,
995
- outs = cudnn_outs ,
996
- ))
997
- else :
998
- copy_rules .append ("filegroup(name = 'cudnn-include')\n " )
999
-
1000
938
# Set up BUILD file for cuda/
1001
939
_tpl (
1002
940
repository_ctx ,
@@ -1017,13 +955,12 @@ def _create_local_cuda_repository(repository_ctx):
1017
955
"%{cudart_lib}" : cuda_libs ["cudart" ].basename ,
1018
956
"%{cublas_lib}" : cuda_libs ["cublas" ].basename ,
1019
957
"%{cusolver_lib}" : cuda_libs ["cusolver" ].basename ,
1020
- "%{cudnn_lib}" : cuda_libs ["cudnn" ].basename ,
1021
958
"%{cufft_lib}" : cuda_libs ["cufft" ].basename ,
1022
959
"%{curand_lib}" : cuda_libs ["curand" ].basename ,
1023
960
"%{cupti_lib}" : cuda_libs ["cupti" ].basename ,
1024
961
"%{copy_rules}" : "\n " .join (copy_rules ),
1025
962
"%{cuda_headers}" : (
1026
- '":cuda-include",\n ' + ' ":cudnn-include", '
963
+ '":cuda-include",'
1027
964
),
1028
965
},
1029
966
"cuda/BUILD" ,
@@ -1058,8 +995,7 @@ def _create_local_cuda_repository(repository_ctx):
1058
995
repository_ctx ,
1059
996
cuda_config ,
1060
997
) +
1061
- "\n cxx_builtin_include_directory: \" %s\" " % cupti_header_dir +
1062
- "\n cxx_builtin_include_directory: \" %s\" " % cudnn_header_dir
998
+ "\n cxx_builtin_include_directory: \" %s\" " % cupti_header_dir
1063
999
)
1064
1000
1065
1001
# For gcc, do not canonicalize system header paths; some versions of gcc
@@ -1155,9 +1091,7 @@ cuda_configure = repository_rule(
1155
1091
"TF_CUDA_CLANG" ,
1156
1092
_TF_DOWNLOAD_CLANG ,
1157
1093
_CUDA_TOOLKIT_PATH ,
1158
- _CUDNN_INSTALL_PATH ,
1159
1094
_TF_CUDA_VERSION ,
1160
- _TF_CUDNN_VERSION ,
1161
1095
_TF_CUDA_COMPUTE_CAPABILITIES ,
1162
1096
"NVVMIR_LIBRARY_DIR" ,
1163
1097
_PYTHON_BIN_PATH ,
0 commit comments