# Cuda Error with Tensorflow > 2.0

## post by somyamohanty on Jul 2, 2020

I am getting runtime error where the Tensorflow library is unable to initialize Cuda with versions higher than 2.0. Here are the software configs:

- **Ubuntu**: 16.04
- **Cuda**: 10.1
- **Driver**: 418.87.01
- **Cuddn**: 7.5.4
- **Tensorflow**: 2.2 (tried with 2.0)

Link to code: [test.py · GitHub](https://gist.github.com/somyamohanty/f64271e774f68962f1a66df822e494a3)

Link to output: [output.log · GitHub](https://gist.github.com/somyamohanty/b5dddf0952e9931b5ad852c2a7ca5d1c)

I have tried using the memory growth approaches described here - [https://github.com/tensorflow/tensorflow/issues/24828](https://github.com/tensorflow/tensorflow/issues/24828)

Also the code works fine in Tensorflow Version 1.8. Not sure what's going on.

---

## post by jeremy on Aug 5, 2020

I’ve only run into this issue when I two models training on the same GPU.

Was the output any differet when you gave the memory growth approaches a try?

```python

devices = tf.config.experimental.list_physical_devices('GPU')
for device in devices:
    tf.config.experimental.set_memory_growth(devices, True)
```

---

## post by MikeBee on Feb 5, 2021

I seem to remember that 1.4 was the last version you can use with 2.0. I could be wrong, however; so check it.

---

### Related topics

| Topic | Replies | Views | Activity |
| --- | --- | --- | --- |
| [Lambda stack versions of cuda and Tensorflow](https://deeptalk.lambda.ai/t/lambda-stack-versions-of-cuda-and-tensorflow/2478) | [1](https://deeptalk.lambda.ai/t/lambda-stack-versions-of-cuda-and-tensorflow/2478/1) | 2.2k | [Jul 2021](https://deeptalk.lambda.ai/t/lambda-stack-versions-of-cuda-and-tensorflow/2478/2) |
| [Started getting TensorFlow profiler error after CUDA update](https://deeptalk.lambda.ai/t/started-getting-tensorflow-profiler-error-after-cuda-update/1676) | [2](https://deeptalk.lambda.ai/t/started-getting-tensorflow-profiler-error-after-cuda-update/1676/1) | 5.3k | [Feb 2021](https://deeptalk.lambda.ai/t/started-getting-tensorflow-profiler-error-after-cuda-update/1676/3) |
| [Problem with CuDNN initialization](https://deeptalk.lambda.ai/t/problem-with-cudnn-initialization/2034) | [1](https://deeptalk.lambda.ai/t/problem-with-cudnn-initialization/2034/1) | 1.2k | [Dec 2020](https://deeptalk.lambda.ai/t/problem-with-cudnn-initialization/2034/2) |
| [CUDA error after sudo apt-get update. UserWarning: CUDA initialization: CUDA unknown error….return torch._C._cuda_getDeviceCount() > 0](https://deeptalk.lambda.ai/t/cuda-error-after-sudo-apt-get-update-userwarning-cuda-initialization-cuda-unknown-error-return-torch--c--cuda-getdevicecount-0/2343) | [1](https://deeptalk.lambda.ai/t/cuda-error-after-sudo-apt-get-update-userwarning-cuda-initialization-cuda-unknown-error-return-torch--c--cuda-getdevicecount-0/2343/1) | 2.7k | [May 2021](https://deeptalk.lambda.ai/t/cuda-error-after-sudo-apt-get-update-userwarning-cuda-initialization-cuda-unknown-error-return-torch--c--cuda-getdevicecount-0/2343/2) |
| [Ubuntu 16.04: Upgrade to TensorFlow 1.4](https://deeptalk.lambda.ai/t/ubuntu-16-04-upgrade-to-tensorflow-1-4/106) | [0](https://deeptalk.lambda.ai/t/ubuntu-16-04-upgrade-to-tensorflow-1-4/106/1) | 2.3k | [Jul 2018](https://deeptalk.lambda.ai/t/ubuntu-16-04-upgrade-to-tensorflow-1-4/106/1) |
