1

I don't have sudo access to the remote pc where cuda is already installed. Now, I have to install tensorflow-gpu on that system. Please give me the step by step guide to install it without sudo.

Operating System : Ubuntu 18.04

talonmies
  • 70,661
  • 34
  • 192
  • 269
Beginner
  • 305
  • 5
  • 24

1 Answers1

3

I had to do this before. Basically, I installed miniconda (you can also use anaconda, same thing and installation works without sudo), and installed everything using conda.

Create my environment and activate it:

conda create --name myenv python=3.6.8
conda actiavate myenv

Install the CUDA things and Tensorflow

conda install cudatoolkit=9.0 cudnn=7.1.2 tensorflow-gpu

Depending on your system, you may need to change version numbers.

Not sure how familiar you are with conda - it is basically a package-manager/repository and environment manager like pip/venv with the addition that it can handle non-python things as well (such as cudnn for example). As a note - if a package is not availabe through conda, you can still use pip as a fallback.

Untested with pip I previously tried to do it without conda and using pip (I ended up failing due to some version conflicts, got frustrated with the process and moved to conda). It gets a little more complicated since you need to manually install it. So first, download cudnn from nvidia and unpack it anywhere you want. Then, you need to add it to the LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=/path/to/cuda/lib64:/path/to/cudnn/lib64/:${LD_                                                                                                                                                                                                                                             LIBRARY_PATH}
  • Thank you for the answer. Is there any way to install withou conda, like pip? – Beginner Mar 21 '19 at 07:18
  • 1
    You can install it manually. Through pip it is not possible as it is not python software and pip only distributes python stuff (as far as I know). I edited the answer above. – Andreas Buchberger Mar 21 '19 at 07:33
  • 1
    You can install tensorflow in a virtual environment by following the instructions at https://www.tensorflow.org/install/pip. If virtualenv is not installed, replacing the command `virtualenv --system-site-packages -p python3 ./venv` with `python3 -m venv ./venv` should work. – tomkot Mar 21 '19 at 07:59