How to switch between CUDNN versions?

Hi I meet a cudnn problem.

I share a Ubuntu14 server with other guys, and there are cuda8 and cudnn5 installed in /usr/local/cuda.

As you may know, current PyTorch requires at least cudnn6, but the installed cudnn5 is used by many other guys. Therefore, I cannot replace cudnn5 with higher version directly.

Then I just download latest cudnn7 and put it in my customized folder: /data/cudnn/cudnn-8.0-v7/.

PyTorch is built from source code with following env-variables:

export CUDNN_LIB_DIR=/data/cudnn/cudnn-8.0-v7/lib64
export CUDNN_include_DIR=/data/cudnn/cudnn-8.0-v7/include

The building process works well.

But when running some examples, error occurs: python: symbol lookup error: /usr/local/lib/python2.7/dist-packages/torch/ undefined symbol: cudnnSetConvolutionGroupCount.

I thought this may be a cudnn-related issue, since there are two different version of CUDNNs installed on my system: the original cudnn5 and my own cudnn7. The program may find libraries of old version cudnn5, not my own cudnn7 which is expected.

Then I set these env-variables in my ~/.bashrc to guide the executables find the right libraries.

export LD_LIBRARY_PATH=/data/cudnn/cudnn-8.0-v7/lib64/:$LD_LIBRARY_PATH
export LIBRARY_PATH=/data/cudnn/cudnn-8.0-v7/lib64/$LIBRARY_PATH
export C_INCLUDE_PATH=/data/cudnn/cudnn-8.0-v7/include/:$C_INCLUDE_PATHexport CPP_INCLUDE_PATH=/data/cudnn/cudnn-8.0-v7/include/:CPP_INCLUDE_PATH

But the error python: symbol lookup error: /usr/local/lib/python2.7/dist-packages/torch/ undefined symbol: cudnnSetConvolutionGroupCount still exists.

So how can I solve this?

Did you find any luck solving this problem?