简体   繁体   中英

Error loading cudart64_110.dll with python 3.8 and tensorflow 2.5.0 using conda on Windows

When I create a python 3.8 environment using tensorflow-gpu 2.5.0 package using conda, I get the error "Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found". However, I have an existing python 3.7 environment that also has tensorflow-gpu 2.5.0, and it is able to find the library OK.

Interestingly enough, if I clone the python 3.7 environment where I'm able to load the library, it also loads in the cloned environment, but if I create a new python 3.7 environment from scratch with tensorflow-gpu 2.5.0, I get the error in that new environment.

I'm not sure why I'm able to load the library in the one environment, but not the others, since the library is in the same location in each of the environments, and it should be a link back to the same file in the package cache, anyhow.

In the python 3.7 environment where I am able to load the cudart64_110.dll, the following relevant packages are installed:

# Name                    Version                   Build  Channel
cudatoolkit               11.3.1               h280eb24_9    conda-forge
python                    3.7.12          h7840368_100_cpython    conda-forge
tensorflow                2.5.0           gpu_py37h23de114_0
tensorflow-base           2.5.0           gpu_py37hb3da07e_0
tensorflow-gpu            2.5.0                h17022bd_0

In the python 3.8 environment where I'm not able to load cudart64_110.dll, the following relevant packages are installed:

# Name                    Version                   Build  Channel
cudatoolkit               11.3.1               h280eb24_9    conda-forge
python                    3.8.12          h7840368_2_cpython    conda-forge
tensorflow                2.5.0           gpu_py38h8e8c102_0
tensorflow-base           2.5.0           gpu_py38hb3da07e_0
tensorflow-gpu            2.5.0                h17022bd_0

Note that both environments include the same cudatoolkit version.

Also, I do realize that I'm mixing channels. However, (a) tensorflow 2.x is not available from conda-forge, and (b) that shouldn't matter in this case since I am able to load tensorflow with CUDA in one environment, but not the other.

For tensorflow_gpu==2.5.0 , you need to install CUDA 11.2 .

Please check the below tested build configuration details and install the suitable cuDNN and CUDA to use TF-gpu 2.5 .

    Version              Python version  Compiler    Build tools    cuDNN    CUDA
    tensorflow_gpu-2.7.0     3.7-3.9     MSVC 2019    Bazel 3.7.2    8.1     11.2
    tensorflow_gpu-2.6.0     3.6-3.9     MSVC 2019    Bazel 3.7.2    8.1     11.2
    tensorflow_gpu-2.5.0     3.6-3.9     MSVC 2019    Bazel 3.7.2    8.1     11.2

Follow this link to install specified CUDA and cuDNN in your system.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM