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.

@Deepak_H_G,

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.

nvidia-smi

Then install CUDA and cuDNN with conda and pip.

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

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__)"))
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/:$CUDNN_PATH/lib

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==8.6.0.163
ERROR: Could not find a version that satisfies the requirement nvidia-cudnn-cu11==8.6.0.163 (from versions: 0.0.1.dev5)
ERROR: No matching distribution found for nvidia-cudnn-cu11==8.6.0.163

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==8.6.0.163 that is out of date?

@Deepak_H_G,

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:

@jacques,

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

We are successfully able to install nvidia-cudnn-cu11==8.6.0.163. 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!

Dear chunduriv:

As you described in on Apr.10, it showed the same installation procedure. That means that installation is perfect (as same as your screenshot, but it have a bug and can not be used.

  1. cudatoolkit could be found

$ nvcc --version
CUDA Toolkit is not installed.

However, I have already installed cudatoolkit 11.8 with your guidelines.

conda install -c conda-forge cudatoolkit=11.8.0
  1. Only show CPU available

import tensorflow as tf
2023-08-03 17:42:07.337886: 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 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-03 17:42:07.926267: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT

It seems a big bug of TensorFlow installation packages for TensorFlow 2.12 and the above.

Notes:

  1. I completely follow the guidelines of “Install Tensorflow with pip”, it shows the above mentioned result.

  2. It is also not useful while I independently install the official (nvidia’s) cudatoolkit 11.8 with the commands you recommended.

i have the same problem. windows 10

ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
torch 2.0.0 requires nvidia-cudnn-cu11==8.5.0.96; platform_system == “Linux” and platform_machine == “x86_64”, but you have nvidia-cudnn-cu11 8.6.0.163 which is incompatible.

pip install tensorflow[and-cuda]

Goodluck.