GPU not found for tensorflow 2.16.1

GPU not found for tensorflow 2.16.1

python == 3.10

nvidia-smi

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.54.15              Driver Version: 550.54.15      CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3080        Off |   00000000:01:00.0  On |                  N/A |
| 57%   46C    P8             43W /  370W |     438MiB /  10240MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A      1463      G   /usr/lib/xorg/Xorg                            150MiB |
|    0   N/A  N/A      1730      G   /usr/bin/gnome-shell                           96MiB |
|    0   N/A  N/A      3753      G   ...irefox/4033/usr/lib/firefox/firefox        180MiB |
+-----------------------------------------------------------------------------------------+

cuda-toolkit-12-4
cudnn9-cuda-12  (9.0.0.312-1).
tensorflow[and-cuda] == 2.16.1

check tensorflow

2024-03-23 18:59:31.306665: I tensorflow/core/platform/cpu_feature_guard.cc:210] 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.
2024-03-23 18:59:31.841802: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-03-23 18:59:32.211521: W tensorflow/core/common_runtime/gpu/gpu_device.cc:2251] 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 https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
[]

I can’t figure out what the problem is. In terms of compatibility everything seems to be good

Solved. Problem in compatibility. Tensorflow not working with CUDA 12.4

Did you manage to run tf 2.16.1?

I tried but I go back to tf 2.15.1 with cuda 12.1