Skip to content

Commit

Permalink
Resolve the libcudnn library to its SONAME, when possible, (tensorflo…
Browse files Browse the repository at this point in the history
…w#3091)

and build the binary with that SONAME, which is supposed to be
ABI-compatible.

When we build our pip packages, we will now build with precisely
the version of the SONAME that we intend to support with the
binary packages.  This is the solution recommended by @3XX0.

Tested by installing cudnn 5.1.3 RC and seeing that the source code
modifications show the use of version "5" (the SONAME version
pointed to by libcudnn.so symlink).

In addition, installing the pip package shows:

>>> import tensorflow as tf
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcurand.so locally
  • Loading branch information
Vijay Vasudevan authored Jun 30, 2016
1 parent db90885 commit 1cebec3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,19 @@ while true; do

if [[ -z "$TF_CUDNN_VERSION" ]]; then
TF_CUDNN_EXT=""
# Resolve to the SONAME of the symlink. Use readlink without -f
# to resolve exactly once to the SONAME. E.g, libcudnn.so ->
# libcudnn.so.4
REALVAL=`readlink ${CUDNN_INSTALL_PATH}/lib64/libcudnn.so`

# Extract the version of the SONAME, if it was indeed symlinked to
# the SONAME version of the file.
if [[ "$REALVAL" =~ .so[.]+([0-9]*) ]];
then
TF_CUDNN_EXT="."${BASH_REMATCH[1]}
TF_CUDNN_VERSION=${BASH_REMATCH[1]}
echo "libcudnn.so resolves to libcudnn${TF_CUDNN_EXT}"
fi
else
TF_CUDNN_EXT=".$TF_CUDNN_VERSION"
fi
Expand Down

0 comments on commit 1cebec3

Please sign in to comment.