tensorflow error: internal: libdevice not found at ./libdevice.10.bc Ubuntu – Solved

Context: I got this error when running tensorflow with python on Ubuntu 20.04, after installing the cuda toolkit by choosing the local deb installation file.

Solution: the solution was to download and install the deb network file instead

https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04

Check if tensorflow is using the GPU

If you run tensorflow in a docker console you can run the following code in your terminal:

docker exec b61a27999cb8 python3 -c "import tensorflow as tf; tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(log_device_placement=True))"

If you run a jupyter notebook you add the following line:

import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))

Data persistence with Docker and tensorflow.

https://docs.docker.com/storage/

https://docs.docker.com/storage/volumes/

https://stackoverflow.com/questions/57341455/how-to-persist-my-notebooks-and-data-in-my-docker-image-container

docker run -it -p 8888:8888 -v /home/personal/Documents/tensorflowData:/tf/notebooks tensorflow/tensorflow:latest-gpu-jupyter

Change SOURCE_FOLDER and DEST_FOLDER accordingly (use absolute paths!).

Now if you navigate to localhost:8888 and create a notebook on DEST_FOLDER, it also should be available on SOURCE_FOLDER.

For tensorflow 2, the destination folder is /tf. You can create a folder of your choice, say: notebook, where you will save your file in your jupyter notebook. Those files will be available in the SOURCE_FOLDER you have set.

The changes in tensorflow-tutorials won’t be kept even if you choose it as your destination folder. You have to use another folder as detailed above.