Skip to content

Commit

Permalink
Remove unused find_cudnn_supported_cuda_versions (microsoft#21620)
Browse files Browse the repository at this point in the history
### Description

The function find_cudnn_supported_cuda_versions is not used anymore.
Remove it.

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
  • Loading branch information
tianleiwu authored Sep 3, 2024
1 parent 8dba8e3 commit 628c0a8
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions onnxruntime/python/onnxruntime_collect_build_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,59 +45,3 @@ def get_cudart_version(find_cudart_version=None):

# convert to list and remove None
return [ver for ver in cudart_found_versions if ver]


def find_cudnn_supported_cuda_versions(build_env=False):
# comments in get_cudart_version apply here
if not sys.platform.startswith("linux"):
warnings.warn("find_cudnn_versions only works on Linux")

cudnn_possible_versions = {None}
if not build_env:
# if not in a build environment, there may be more than one installed cudnn.
# https://developer.nvidia.com/rdp/cudnn-archive to include all that may support Cuda 10+.
cudnn_possible_versions.update(
{
"8.2",
"8.1.1",
"8.1.0",
"8.0.5",
"8.0.4",
"8.0.3",
"8.0.2",
"8.0.1",
"7.6.5",
"7.6.4",
"7.6.3",
"7.6.2",
"7.6.1",
"7.6.0",
"7.5.1",
"7.5.0",
"7.4.2",
"7.4.1",
"7.3.1",
"7.3.0",
}
)

def get_cudnn_supported_cuda_version(find_cudnn_version=None):
cudnn_lib_filename = "libcudnn.so"
if find_cudnn_version:
cudnn_lib_filename = cudnn_lib_filename + "." + find_cudnn_version

# in cudnn.h cudnn version are calculated as:
# #define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)
try:
cudnn = ctypes.CDLL(cudnn_lib_filename)
# cudnn_ver = cudnn.cudnnGetVersion()
cuda_ver = cudnn.cudnnGetCudartVersion()
return cuda_ver
except Exception:
return None

# use set to avoid duplications
cuda_found_versions = {get_cudnn_supported_cuda_version(cudnn_version) for cudnn_version in cudnn_possible_versions}

# convert to list and remove None
return [ver for ver in cuda_found_versions if ver]

0 comments on commit 628c0a8

Please sign in to comment.