Building pytorch from source (cuda dependencies)

I’m trying to install pytorch from source in a cluster in which CUDA/CDNN directories aren’t the standard.

I’ve seen I have to export these environment variables:

#   CUDA_HOME (Linux/OS X)
#     specify where CUDA is installed; usually /usr/local/cuda or
#     /usr/local/cuda-x.y
#     specify where cuDNN is installed
#     we will search for libraries in these paths

Could you specify where should they point to?
I expected to use cuda 9.0 with cdnn 7.5. I haven’t seen any compatibility restriction about it. Are both ok?
And lastly, is it as easy as export them as environment variables using os.environ or from bash or is there any special function to do that?. I’m asking that cos I’d say i exported them but installer is still searching in directory by default.