Why is Tensorflow not recognizing my GPU after conda install?

August 2021 Conda install may be working now, as according to @ComputerScientist in the comments below, conda install tensorflow-gpu==2.4.1 will give cudatoolkit-10.1.243 and cudnn-7.6.5

The following was written in Jan 2021 and is out of date

Currently conda install tensorflow-gpu installs tensorflow v2.3.0 and does NOT install the conda cudnn or cudatoolkit packages. Installing them manually (e.g. with conda install cudatoolkit=10.1) does not seem to fix the problem either.

A solution is to install an earlier version of tensorflow, which does install cudnn and cudatoolkit, then upgrade with pip

conda install tensorflow-gpu=2.1
pip install tensorflow-gpu==2.3.1

(2.4.0 uses cuda 11.0 and cudnn 8.0, however cudnn 8.0 is not in anaconda as of 16/12/2020)

Edit: please also see @GZ0’s answer, which links to a github discussion with a one-line solution

Leave a Comment