# Problem on connecting tensorflow with cuda

**URL:** <https://discuss.ai.google.dev/t/problem-on-connecting-tensorflow-with-cuda/32582>\
**Category:** General Discussion\
**Tags:** gpu, install, help\_request\
**Created:** [January 28, 2022, 10:50am UTC](https://discuss.ai.google.dev/t/problem-on-connecting-tensorflow-with-cuda/32582 "2022-01-28T10:50:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![titu\_kumar](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/titu_kumar/32/10601_2.png) [@titu\_kumar](https://discuss.ai.google.dev/u/titu_kumar)\
**Post date:** [January 28, 2022, 10:50am UTC](https://discuss.ai.google.dev/t/problem-on-connecting-tensorflow-with-cuda/32582/1 "2022-01-28T10:50:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bhack](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/bhack/32/6388_2.png) [@Bhack](https://discuss.ai.google.dev/u/Bhack)\
**Post date:** [January 28, 2022, 11:03am UTC](https://discuss.ai.google.dev/t/problem-on-connecting-tensorflow-with-cuda/32582/3 "2022-01-28T11:03:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![titu\_kumar](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/titu_kumar/32/10601_2.png) [@titu\_kumar](https://discuss.ai.google.dev/u/titu_kumar)\
**Post date:** [January 28, 2022, 12:36pm UTC](https://discuss.ai.google.dev/t/problem-on-connecting-tensorflow-with-cuda/32582/5 "2022-01-28T12:36:56Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![Bhack](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/bhack/32/6388_2.png) [@Bhack](https://discuss.ai.google.dev/u/Bhack)\
**Post date:** [January 28, 2022, 1:13pm UTC](https://discuss.ai.google.dev/t/problem-on-connecting-tensorflow-with-cuda/32582/6 "2022-01-28T13:13:36Z")

</div>

> [@titu\_kumar](#):
>
> 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

Your TF version requires CUDA 11.

---

<div class="post-metadata">

**Author:** ![titu\_kumar](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/titu_kumar/32/10601_2.png) [@titu\_kumar](https://discuss.ai.google.dev/u/titu_kumar)\
**Post date:** [January 28, 2022, 1:35pm UTC](https://discuss.ai.google.dev/t/problem-on-connecting-tensorflow-with-cuda/32582/7 "2022-01-28T13:35:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Bhack](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/bhack/32/6388_2.png) [@Bhack](https://discuss.ai.google.dev/u/Bhack)\
**Post date:** [January 28, 2022, 1:52pm UTC](https://discuss.ai.google.dev/t/problem-on-connecting-tensorflow-with-cuda/32582/8 "2022-01-28T13:52:55Z")

</div>

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:

> **[Build software better, together](https://github.com/tensorflow/tensorflow/security/policy#reporting-vulnerabilities)**
>
> GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.

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

---

<div class="post-metadata">

**Author:** ![titu\_kumar](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/titu_kumar/32/10601_2.png) [@titu\_kumar](https://discuss.ai.google.dev/u/titu_kumar)\
**Post date:** [January 28, 2022, 2:10pm UTC](https://discuss.ai.google.dev/t/problem-on-connecting-tensorflow-with-cuda/32582/9 "2022-01-28T14:10:46Z")

</div>

Ok thanks.  
Anyway i have cuda version 9.1

---

<div class="post-metadata">

**Author:** ![Bhack](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/bhack/32/6388_2.png) [@Bhack](https://discuss.ai.google.dev/u/Bhack)\
**Post date:** [January 28, 2022, 2:23pm UTC](https://discuss.ai.google.dev/t/problem-on-connecting-tensorflow-with-cuda/32582/11 "2022-01-28T14:23:21Z")

</div>

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

> **[Docker  |  TensorFlow](https://www.tensorflow.org/install/docker?hl=ko)**

---

<div class="post-metadata">

**Author:** ![makam\_Kumar](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/makam_kumar/32/11663_2.png) [@makam\_Kumar](https://discuss.ai.google.dev/u/makam_Kumar)\
**Post date:** [August 4, 2022, 6:14am UTC](https://discuss.ai.google.dev/t/problem-on-connecting-tensorflow-with-cuda/32582/13 "2022-08-04T06:14:33Z")

</div>

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
