TensorFlow Installation Error

Dear team, I am installing tensorflow on my gpu laptop as per the installation instructions given in the website. I get the following error.

023-04-03 15:35:42.735382: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0.
2023-04-03 15:35:42.760248: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-04-03 15:35:43.175060: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2023-04-03 15:35:43.612999: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at linux/sysfs-bus-pci at v6.0 · torvalds/linux · GitHub
2023-04-03 15:35:43.629685: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1956] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at Install TensorFlow with pip for how to download and setup the required libraries for your platform.
Skipping registering GPU devices…

I am installing on Ubuntu 22.04 having nvidia 3050 rtx graphics card.


Welcome to the Tensorflow Forum!

Have you followed GPU Setup instructions?

First install the NVIDIA GPU driver if you have not. You can use the following command to verify it is installed.


Then install CUDA and cuDNN with conda and pip.

conda install -c conda-forge cudatoolkit=11.8.0
pip install nvidia-cudnn-cu11==

Configure the system paths. You can do it with the following command every time you start a new terminal after activating your conda environment.

CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))

For your convenience it is recommended that you automate it with the following commands. The system paths will be automatically configured when you activate this conda environment.

mkdir -p $CONDA_PREFIX/etc/conda/activate.d
CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/:$CUDNN_PATH/lib' > $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh

Thank you!

Yes. I followed the same steps as mentioned in the website

On Windows 11, WSL 2, the installation procedure fails at the following step:

>pip install nvidia-cudnn-cu11==
ERROR: Could not find a version that satisfies the requirement nvidia-cudnn-cu11== (from versions: 0.0.1.dev5)
ERROR: No matching distribution found for nvidia-cudnn-cu11==

I have tried copying the cudann files from C:\Program Files\NVIDIA\CUDNN\v8.6.0.163 into C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8 but that makes no difference. I wonder if it’s the pip install of nvidia-cudnn-cu11== that is out of date?


Sorry for the late response.

Please install CUDA11.8 as shown below and let us know?

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-ubuntu2204-11-8-local_11.8.0-520.61.05-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-11-8-local_11.8.0-520.61.05-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-11-8-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda

Note: Please try to install directly in terminal and restart the system.

Thank you!

Continuing on Windows 11, WSL 2:

  • Apps->Installed Apps:
    only show 11.8.0 CUDA no 12.1
    But from the command prompt, issuing the command “>nvidia-smi” reports:
  • NVIDIA-SMI 531.41 Driver Version: 531.41 CUDA Version: 12.1

Where version 12.1 comes from, when the installed apps report 11.8.0 I have no idea.

So it’s a cpu only TensorFlow installation for me :frowning:


>pip install nvidia-cudnn-cu11==
ERROR: Could not find a version that satisfies the requirement nvidia-cudnn-cu11== (from versions: 0.0.1.dev5)
ERROR: No matching distribution found for nvidia-cudnn-cu11==

We are successfully able to install nvidia-cudnn-cu11== Please refer to the below screesnshot

We request you to create a new issue for WSL2 blocker. This makes it easy to track and support you quickly.

Thank you!