Is it needed to install Cuda Toolkit from NVIDIA in Win10 to use Cuda when you already have cudatoolkit package in your Anaconda environment?

Issue

I have cudatoolkit and cudnn packages installed in my anaconda environment but tensorflow does not recognize my GPU device. In some web sources I have seen that you can use Cuda by only installing necessary anaconda packages. So, what I would like to know is that do I have to install NVIDIA Cuda from its website to be able to use it or would it lead to conflicts?

Solution

I think something wrong with your environment variables. I can recommend these steps:

  • Create a new environment

  • Install required packages:
    conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0 python3 -m pip install tensorflow

  • Verify the installation, first import tensorflow
    python3 -c "import tensorflow as tf;

  • Then check the GPU
    print(tf.config.list_physical_devices('GPU'))"

This should be work
`

Answered By – Emrejik

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published