Problem on connecting tensorflow with cuda

Hii, i want to install tensorflow in a linux machine where cuda is present.

±----------------------------------------------------------------------------+
| NVIDIA-SMI 390.77 Driver Version: 390.77 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Tesla K40c On | 00000000:03:00.0 Off | 0 |
| 24% 45C P8 23W / 235W | 11MiB / 11441MiB | 0% Default |
±------------------------------±---------------------±---------------------+
| 1 Quadro K620 On | 00000000:04:00.0 On | N/A |
| 36% 49C P8 1W / 30W | 573MiB / 1999MiB | 0% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 1 1781 G /usr/bin/X 22MiB |
| 1 58011 G /usr/bin/X 34MiB |
| 1 59222 G /usr/bin/gnome-shell 87MiB |
| 1 66073 G /usr/bin/gnome-shell 186MiB |
| 1 110408 G /usr/bin/X 126MiB |
| 1 111855 G /usr/bin/gnome-shell 101MiB |
±----------------------------------------------------------------------------+
but when i import import tensorflow as tf it gives some kind of error
2022-01-28 15:16:56.056131: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library ‘libcudart.so.11.0’; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-9.1/lib64
2022-01-28 15:16:56.056200: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

Can you run nvcc --version? What is the output?

@Bhack i get something like

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85

Your TF version requires CUDA 11.

ok…if i have cuda verion 9.1 then can u please suggest which tensorflow version will support it.Dos it tensorflow 1.5

I always suggest to use the last TF version as we just backport security fixes for a few releases.

Other kind of more or less “minor” bugs or missing features are not backported.

We have mainly an end of life “informal policy” on TF releases that It is related to the security support lifetime.

/cc @yarri-oss @mihaimaruseac @thea probably we can claim this a little bit more formally giving enought visibility on the website and github.

See more at:

Note that we mostly do patch releases for security reasons and each version of TensorFlow is supported for only 1 year after the release.

Ok thanks.
Anyway i have cuda version 9.1

You could upgrade cuda or use our prepared GPU Docker images:

nvidia-smi
Thu Aug 4 11:39:08 2022
±----------------------------------------------------------------------------+
| NVIDIA-SMI 470.103.01 Driver Version: 470.103.01 CUDA Version: 11.4 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce … Off | 00000000:2D:00.0 On | N/A |
| 31% 38C P8 29W / 250W | 676MiB / 11016MiB | 0% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1127 G /usr/lib/xorg/Xorg 35MiB |
| 0 N/A N/A 1666 G /usr/lib/xorg/Xorg 257MiB |
| 0 N/A N/A 1793 G /usr/bin/gnome-shell 42MiB |
| 0 N/A N/A 2308 G /usr/lib/firefox/firefox 106MiB |
| 0 N/A N/A 49759 G …535836030186845765,131072 216MiB |
±----------------------------------------------------------------------------+
(transformers) robotics@robotics-HP-Z8-G4-Workstation:~$ python
Python 3.10.4 (main, Mar 31 2022, 08:41:55) [GCC 7.5.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import tensorflow as tf
2022-08-04 11:40:15.341881: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0.
2022-08-04 11:40:15.346247: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library ‘libcudart.so.11.0’; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2022-08-04 11:40:15.346269: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243