# Failed to get convolution algorithm. This is probably because cuDNN failed to initialize

**URL:** <https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147>\
**Category:** cuDNN\
**Created:** [November 8, 2018, 4:40pm UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147 "2018-11-08T16:40:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![charel.van.hoof](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/charel.van.hoof/32/435979_2.png) [@charel.van.hoof](https://forums.developer.nvidia.com/u/charel.van.hoof)\
**Post date:** [November 8, 2018, 4:40pm UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/1 "2018-11-08T16:40:16Z")

</div>

How come I get cuda errors when I run a colab on my PC. Next you try to find your way in the impossible support pages of Nvidia.  
I get this error if I run CPU accelerator runtime: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize  
Everuting runs fine without the GPU accelerator.  
Tried a lot downloaded some \cudnn-10.0-windows10-x64-v7.3.1.20.zip and did the manual coy past instruction (really?) Did not help.

Windows 10  
Google colab  
Keras Neural Network  
Cuda version 10

Any help most welcome

---

<div class="post-metadata">

**Author:** ![charel.van.hoof](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/charel.van.hoof/32/435979_2.png) [@charel.van.hoof](https://forums.developer.nvidia.com/u/charel.van.hoof)\
**Post date:** [November 8, 2018, 4:45pm UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/2 "2018-11-08T16:45:54Z")

</div>

Neural network in case it matters

self.model = tf.keras.models.Sequential()  
self.model.add(tf.keras.layers.Conv2D(32, (8, 8), input\_shape=(84, 84, NUM\_FRAMES), strides=(4, 4)))  
self.model.add(tf.keras.layers.Activation(‘relu’))  
self.model.add(tf.keras.layers.Conv2D(64, (4, 4), strides=(2, 2)))  
self.model.add(tf.keras.layers.Activation(‘relu’))  
self.model.add(tf.keras.layers.Conv2D(64, (3, 3)))  
self.model.add(tf.keras.layers.Activation(‘relu’))  
self.model.add(tf.keras.layers.Flatten())  
self.model.add(tf.keras.layers.Dense(512))  
self.model.add(tf.keras.layers.Activation(‘relu’))  
self.model.add(tf.keras.layers.Dense(NUM\_ACTIONS))

---

<div class="post-metadata">

**Author:** ![charel.van.hoof](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/charel.van.hoof/32/435979_2.png) [@charel.van.hoof](https://forums.developer.nvidia.com/u/charel.van.hoof)\
**Post date:** [November 8, 2018, 5:01pm UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/3 "2018-11-08T17:01:35Z")

</div>

A simple check colab run on my pc

import tensorflow as tf  
device\_name = tf.test.gpu\_device\_name()  
if device\_name != ‘/device:GPU:0’:  
raise SystemError(‘GPU device not found’)  
print(‘Found GPU at: {}’.format(device\_name))

shows  
Found GPU at: /device:GPU:0

and result of test:  
Time (s) to convolve 32x7x7x3 filter over random 100x100x100x3 images (batch x height x width x channel). Sum of ten runs.  
CPU (s):  
9.33978390694  
GPU (s):  
0.196625232697  
GPU speedup over CPU: 47x

So I do have GPU power, somehow Conv2D crashes?

---

<div class="post-metadata">

**Author:** ![stevedevney](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@stevedevney](https://forums.developer.nvidia.com/u/stevedevney)\
**Post date:** [December 11, 2018, 11:37am UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/4 "2018-12-11T11:37:10Z")

</div>

Were you ever able to solve this problem? I have the same issue.

---

<div class="post-metadata">

**Author:** ![iro2017009](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@iro2017009](https://forums.developer.nvidia.com/u/iro2017009)\
**Post date:** [January 2, 2019, 3:07pm UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/5 "2019-01-02T15:07:33Z")

</div>

This is a compatibility issue with the new versions of tensorflow-gpus 1.10.x plus versions with cuda 9.0 and cudnn 7.0.5. Easiest fix is to downgrade tensorflow to version 1.8

pip install --upgrade tensorflow-gpu==1.8.0

will solve the problem.

---

<div class="post-metadata">

**Author:** ![dt.parmpal](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@dt.parmpal](https://forums.developer.nvidia.com/u/dt.parmpal)\
**Post date:** [January 21, 2019, 12:53pm UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/6 "2019-01-21T12:53:48Z")

</div>

Thanx iro2017009, it works for me.

---

<div class="post-metadata">

**Author:** ![shuonan](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@shuonan](https://forums.developer.nvidia.com/u/shuonan)\
**Post date:** [April 5, 2019, 9:07pm UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/7 "2019-04-05T21:07:03Z")

</div>

what if I am using tf\_2.0alpha?

---

<div class="post-metadata">

**Author:** ![mania\_baghda](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mania\_baghda](https://forums.developer.nvidia.com/u/mania_baghda)\
**Post date:** [April 19, 2019, 7:55pm UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/8 "2019-04-19T19:55:14Z")

</div>

I have tf 2.0 alpha  
I had to downgrade to CUDA 10.0 and cuDNN 7.4 to make it work.

---

<div class="post-metadata">

**Author:** ![zouzhipeng.1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@zouzhipeng.1](https://forums.developer.nvidia.com/u/zouzhipeng.1)\
**Post date:** [May 10, 2019, 12:26pm UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/9 "2019-05-10T12:26:45Z")

</div>

However I have GPUs : RTX 2070, the CUDA recommended by invidia is 10.0, so I can only download TensorFlow v1.13.1 according to the TensorFlow official description. But I got errors above, how can I solve this problem?

---

<div class="post-metadata">

**Author:** ![dt.parmpal](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@dt.parmpal](https://forums.developer.nvidia.com/u/dt.parmpal)\
**Post date:** [May 10, 2019, 12:36pm UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/10 "2019-05-10T12:36:41Z")

</div>

@zouzhipeng verify the cudnn version also it should 7.4.1 for tensorflow 1.13.1 with cuda 10.0

---

<div class="post-metadata">

**Author:** ![zouzhipeng.1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@zouzhipeng.1](https://forums.developer.nvidia.com/u/zouzhipeng.1)\
**Post date:** [May 10, 2019, 1:05pm UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/11 "2019-05-10T13:05:54Z")

</div>

> [@](#):
>
> @zouzhipeng verify the cudnn version also it should 7.4.1 for tensorflow 1.13.1 with cuda 10.0

I have checked and verified again, it is the same as what I reported , and I have run the example code provided by invidia named mnistCUDNN, this test passed. But I can’t get the conv in TensorFlow v1.13.1, the the TensorFlow is installed by pip, the version of python is python3.6.5, the version of CUDA is 10.0, and the CUDNN is 7.4.1.

So what is the reason of this problem ?

---

<div class="post-metadata">

**Author:** ![dt.parmpal](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@dt.parmpal](https://forums.developer.nvidia.com/u/dt.parmpal)\
**Post date:** [May 10, 2019, 1:12pm UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/12 "2019-05-10T13:12:26Z")

</div>

> [@](#):
>
> > [@](#):
> >
> > @zouzhipeng verify the cudnn version also it should 7.4.1 for tensorflow 1.13.1 with cuda 10.0
> 
> I have checked and verified again, it is the same as what I reported , and I have run the example code provided by invidia named mnistCUDNN, this test passed. But I can’t get the conv in TensorFlow v1.13.1, the the TensorFlow is installed by pip, the version of python is python3.6.5, the version of CUDA is 10.0, and the CUDNN is 7.4.1.
> 
> So what is the reason of this problem ?

What os you are using and what error you received?

---

<div class="post-metadata">

**Author:** ![zouzhipeng.1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@zouzhipeng.1](https://forums.developer.nvidia.com/u/zouzhipeng.1)\
**Post date:** [May 10, 2019, 1:25pm UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/13 "2019-05-10T13:25:04Z")

</div>

> [@](#):
>
> > [@](#):
> >
> > > [@](#):
> > >
> > > @zouzhipeng verify the cudnn version also it should 7.4.1 for tensorflow 1.13.1 with cuda 10.0
> > 
> > I have checked and verified again, it is the same as what I reported , and I have run the example code provided by invidia named mnistCUDNN, this test passed. But I can’t get the conv in TensorFlow v1.13.1, the the TensorFlow is installed by pip, the version of python is python3.6.5, the version of CUDA is 10.0, and the CUDNN is 7.4.1.
> > 
> > So what is the reason of this problem ?
> 
> What os you are using and what error you received?

Now, we are using CentOS Linux release 7.6.1810 (Core)

The error is

```auto
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test.py", line 115, in <module>
    model.train(input_fn, steps=num_steps)
  File "/usr/local/python3.6/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 358, in train
    loss = self._train_model(input_fn, hooks, saving_listeners)
  File "/usr/local/python3.6/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1124, in _train_model
    return self._train_model_default(input_fn, hooks, saving_listeners)
  File "/usr/local/python3.6/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1158, in _train_model_default
    saving_listeners)
  File "/usr/local/python3.6/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1407, in _train_with_estimator_spec
    _, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
  File "/usr/local/python3.6/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 676, in run
    run_metadata=run_metadata)
  File "/usr/local/python3.6/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1171, in run
    run_metadata=run_metadata)
  File "/usr/local/python3.6/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1270, in run
    raise six.reraise(*original_exc_info)
  File "/usr/local/python3.6/lib/python3.6/site-packages/six.py", line 693, in reraise
    raise value
  File "/usr/local/python3.6/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1255, in run
    return self._sess.run(*args, **kwargs)
  File "/usr/local/python3.6/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1327, in run
    run_metadata=run_metadata)
  File "/usr/local/python3.6/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1091, in run
    return self._sess.run(*args, **kwargs)
  File "/usr/local/python3.6/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 929, in run
    run_metadata_ptr)
  File "/usr/local/python3.6/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1152, in _run
    feed_dict_tensor, options, run_metadata)
  File "/usr/local/python3.6/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1328, in _do_run
    run_metadata)
  File "/usr/local/python3.6/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1348, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
	 [[node ConvNet/conv2d/Conv2D (defined at test.py:45)]]

```

And the code is cloned from [https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3\_NeuralNetworks/convolutional\_network.py](https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3_NeuralNetworks/convolutional_network.py)

---

<div class="post-metadata">

**Author:** ![mikechen6688](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mikechen6688](https://forums.developer.nvidia.com/u/mikechen6688)\
**Post date:** [May 20, 2019, 9:38am UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/14 "2019-05-20T09:38:07Z")

</div>

I have the same problem.

It seems that I have already installed it into Ubuntu 16.04 LTS(Ubuntu 18.04 LTS has a gcc compatibility problem, so I uninstalled Ubuntu 18.04 LTS). I have installed two environments including NVIDIA-Linux-x86\_64-415.27.run, Anaconda3-2019.03-Linux-x86\_64.sh. With usage of conda install tensorflow(v13.1), I installed tensorflow-gpu that includes both cudatoolkit-10.0.130 and cudnn-7.3.1.

I can use the following commands to initiitate the Jupyter environment.

(tf-gpu) mike@mike:~$ conda install jupyter  
…  
(tf-gpu) mike@mike:~$ python -m ipykernel install --user --name tf-gpu --display-name “TensorFlow-GPU”  
(tf-gpu) mike@mike:~$ jupyter notebook

However, I had the the error. After I put the MNIST test code into the cell of TensorFlow-GPU, It failed to get convolution algorithm since cuDNN failed to initialize. I update all commands according to this forum suggestoins. However, it still had the problem after updating tensorflow-gpu in the environment of tf-gpu. Please have a look at the following information.

UnknownError: Failed to get convolution algorithm

UnknownError Traceback (most recent call last)  
 in   
33  
34 model.fit(X\_train, y\_train, batch\_size=128, epochs=15, verbose=1,  
—\> 35 validation\_data=(X\_test,y\_test), callbacks=[tensor\_board])  
36

~/anaconda3/envs/tf-gpu/lib/python3.7/site-packages/keras/engine/training.py in fit(self, x, y, batch\_size, epochs, verbose, callbacks, validation\_split, validation\_data, shuffle, class\_weight, sample\_weight, initial\_epoch, steps\_per\_epoch, validation\_steps, \*\*kwargs)  
1037 initial\_epoch=initial\_epoch,  
1038 steps\_per\_epoch=steps\_per\_epoch,  
 → 1039 validation\_steps=validation\_steps)  
1040

…

UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.  
[[{{node conv2d\_1/convolution}}]]  
[[{{node metrics/acc/Mean}}]]

Please help me solve the issue.

Thanks in advance,

Mike

---

<div class="post-metadata">

**Author:** ![dt.parmpal](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@dt.parmpal](https://forums.developer.nvidia.com/u/dt.parmpal)\
**Post date:** [May 20, 2019, 9:56am UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/15 "2019-05-20T09:56:02Z")

</div>

> [@](#):
>
> Mike

tensorflow 1.13.1 require cudnn version 7.4.1. update your cudnn it will work.

---

<div class="post-metadata">

**Author:** ![zouzhipeng.1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@zouzhipeng.1](https://forums.developer.nvidia.com/u/zouzhipeng.1)\
**Post date:** [May 20, 2019, 10:06am UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/16 "2019-05-20T10:06:43Z")

</div>

Actually, I tried many versions from 7.3-7.5, but it doesn’t wok.

---

<div class="post-metadata">

**Author:** ![dt.parmpal](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@dt.parmpal](https://forums.developer.nvidia.com/u/dt.parmpal)\
**Post date:** [May 20, 2019, 11:00am UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/17 "2019-05-20T11:00:16Z")

</div>

check the cudnn version at /usr/include/cudnn.h it should like  
#define CUDNN\_MAJOR 7  
#define CUDNN\_MINOR 4  
#define CUDNN\_PATCHLEVEL 1  
and also try to install tensoflow by pip  
pip install tensorflow-gpu

---

<div class="post-metadata">

**Author:** ![hydrioninvoker](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hydrioninvoker](https://forums.developer.nvidia.com/u/hydrioninvoker)\
**Post date:** [August 2, 2019, 6:36am UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/18 "2019-08-02T06:36:02Z")

</div>

> [@](#):
>
> Actually, I tried many versions from 7.3-7.5, but it doesn’t wok.

hello, are you using tensorflow when you met this problem? Maybe the problem is raised by your tensorflow verson, try to update tf to version 1.14.0.  
My problem is quite similiar to yours, I also passed cudnn test in cuda 10.0 and cudnn 7.5.0 like you, but when I run tensorflow it still has this problem. Finally, I solve this problem by update tensorflow’s version.

---

<div class="post-metadata">

**Author:** ![cdesivo92](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@cdesivo92](https://forums.developer.nvidia.com/u/cdesivo92)\
**Post date:** [August 11, 2019, 9:36pm UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/19 "2019-08-11T21:36:38Z")

</div>

> [@](#):
>
> This is a compatibility issue with the new versions of tensorflow-gpus 1.10.x plus versions with cuda 9.0 and cudnn 7.0.5. Easiest fix is to downgrade tensorflow to version 1.8
> 
> pip install --upgrade tensorflow-gpu==1.8.0
> 
> will solve the problem.

I tried this but it says that there is no version that satisfies my requirements. I’m using a jetson nano.

---

<div class="post-metadata">

**Author:** ![michael.gschwind](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@michael.gschwind](https://forums.developer.nvidia.com/u/michael.gschwind)\
**Post date:** [September 5, 2019, 7:36pm UTC](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147/20 "2019-09-05T19:36:31Z")

</div>

> [@](#):
>
> This is a compatibility issue with the new versions of tensorflow-gpus 1.10.x plus versions with cuda 9.0 and cudnn 7.0.5. Easiest fix is to downgrade tensorflow to version 1.8
> 
> pip install --upgrade tensorflow-gpu==1.8.0
> 
> will solve the problem.

So I tried TF 1.8, but that won’t work with CUDA 10.0.  
$ pip3 install --upgrade tensorflow-gpu==1.8.0

[…]

~/.local/lib/python3.6/site-packages/tensorflow/python/pywrap\_tensorflow.py in   
72 for some common reasons and solutions. Include the entire stack trace  
73 above this error message when asking for help.“”" % traceback.format\_exc()  
—\> 74 raise ImportError(msg)  
75  
76 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long

ImportError: Traceback (most recent call last):  
File “/home/mkg/.local/lib/python3.6/site-packages/tensorflow/python/pywrap\_tensorflow.py”, line 58, in   
from tensorflow.python.pywrap\_tensorflow\_internal import \*  
File “/home/mkg/.local/lib/python3.6/site-packages/tensorflow/python/pywrap\_tensorflow\_internal.py”, line 28, in   
\_pywrap\_tensorflow\_internal = swig\_import\_helper()  
File “/home/mkg/.local/lib/python3.6/site-packages/tensorflow/python/pywrap\_tensorflow\_internal.py”, line 24, in swig\_import\_helper  
\_mod = imp.load\_module(‘\_pywrap\_tensorflow\_internal’, fp, pathname, description)  
File “/usr/lib/python3.6/imp.py”, line 243, in load\_module  
return load\_dynamic(name, filename, file)  
File “/usr/lib/python3.6/imp.py”, line 343, in load\_dynamic  
return \_load(spec)  
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory

[Next page](https://forums.developer.nvidia.com/t/failed-to-get-convolution-algorithm-this-is-probably-because-cudnn-failed-to-initialize/67147.md?page=2)
