From 267f956246750357f8eff2b88b2e6c8741b46775 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Tue, 16 Jun 2020 16:39:49 -0700 Subject: [PATCH] load libcupti.so shared object if libcupti.so.10.1 is not installed. This makes it possible for tensorflow to load CUPTI 10.2 via libcupti.so symlink in the event that libcupti.so.10.1 is missing. PiperOrigin-RevId: 316782424 Change-Id: I930912f1d3a8fa80e8b91c41214c374650f08847 --- .../stream_executor/platform/default/dso_loader.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tensorflow/stream_executor/platform/default/dso_loader.cc b/tensorflow/stream_executor/platform/default/dso_loader.cc index fb7d88aaedb..01af4114536 100644 --- a/tensorflow/stream_executor/platform/default/dso_loader.cc +++ b/tensorflow/stream_executor/platform/default/dso_loader.cc @@ -101,13 +101,11 @@ port::StatusOr GetCurandDsoHandle() { } port::StatusOr GetCuptiDsoHandle() { -#if defined(ANDROID_TEGRA) - // On Android devices the CUDA version number is not added to the library - // name. + // Load specific version of CUPTI this is built. + auto status_or_handle = GetDsoHandle("cupti", GetCudaVersion()); + if (status_or_handle.ok()) return status_or_handle; + // Load whatever libcupti.so user specified. return GetDsoHandle("cupti", ""); -#else - return GetDsoHandle("cupti", GetCudaVersion()); -#endif } port::StatusOr GetCudnnDsoHandle() {