Thursday, 24 June 2021

Tensorflow GPU / CUDA installation on Ubuntu

I have set up a Ubuntu 18.04, and tried to make Tensorflow 2.2 GPU work (I have a Nvidia/CUDA graphic card) with Python. Even after reading the documentation https://www.tensorflow.org/install/gpu#linux_setup, it failed (see below for details about how it failed).

Question: would you have a canonical "todo" list (starting point: freshly installed Ubuntu server) on how to install tensorflow-gpu and make it work, with as few steps?

Notes:

  • I have read many similar forum posts, and I think that having a canonical "todo" (from a fresh Ubuntu install to having tensorflow-gpu working) would be interesting, with a few steps / bash commands

  • the documentation I used involved

      export LD_LIBRARY_PATH...
    
      # Add NVIDIA package repository
      sudo apt-key adv --fetch-keys http://developer.download...
      ...
      # Install CUDA and tools. Include optional NCCL 2.x
      sudo apt install cuda9.0 cuda...
    

    Even after a lot of trial and errors (I don't copy/paste all the different errors here, would be too long), then at the end:

      import tensorflow
    

    always failed. Some reasons included ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory. I have already read the relevant question here, or this very long (!) github issue.

  • After some trial and error, import tensorflow works, but it doesn't use the GPU (see also Tensorflow not running on GPU).



from Tensorflow GPU / CUDA installation on Ubuntu

No comments:

Post a Comment