Tensorflow 2.10 doesn't detect GPU

Have installed TF 2.20. However it doesn’t detect my GPU (3060 with latest drivers).
nvidia-smi:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 528.02       Driver Version: 528.02       CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name            TCC/WDDM | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ... WDDM  | 00000000:01:00.0  On |                  N/A |
|  0%   34C    P8    17W / 170W |   1836MiB / 12288MiB |      8%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      2380    C+G   ...zpdnekdrzrea0\Spotify.exe    N/A      |
|    0   N/A  N/A      2452    C+G   ...t\Teams\current\Teams.exe    N/A      |
|    0   N/A  N/A      6592      C   ...5n2kfra8p0\python3.10.exe    N/A      |
|    0   N/A  N/A      7128    C+G   ...logioptionsplus_agent.exe    N/A      |
|    0   N/A  N/A      9108    C+G   C:\Windows\explorer.exe         N/A      |
|    0   N/A  N/A      9492    C+G   ...wekyb3d8bbwe\Video.UI.exe    N/A      |
|    0   N/A  N/A      9944    C+G   ...\app-1.0.9010\Discord.exe    N/A      |
|    0   N/A  N/A     10520    C+G   ...n1h2txyewy\SearchHost.exe    N/A      |
|    0   N/A  N/A     10544    C+G   ...artMenuExperienceHost.exe    N/A      |
|    0   N/A  N/A     11000    C+G   ...cw5n1h2txyewy\LockApp.exe    N/A      |
|    0   N/A  N/A     11572    C+G   ...perience\NVIDIA Share.exe    N/A      |
|    0   N/A  N/A     11576    C+G   ...h2txyewy\FESearchHost.exe    N/A      |
|    0   N/A  N/A     11844    C+G   ...lPanel\SystemSettings.exe    N/A      |
|    0   N/A  N/A     12584    C+G   ...t\Teams\current\Teams.exe    N/A      |
|    0   N/A  N/A     13516    C+G   ...oft OneDrive\OneDrive.exe    N/A      |
|    0   N/A  N/A     14436    C+G   ...e\PhoneExperienceHost.exe    N/A      |
|    0   N/A  N/A     15464    C+G   ...perience\NVIDIA Share.exe    N/A      |
|    0   N/A  N/A     15584    C+G   ...2txyewy\TextInputHost.exe    N/A      |
|    0   N/A  N/A     17032    C+G   ...ge\Application\msedge.exe    N/A      |
|    0   N/A  N/A     18548    C+G   ...h8wxbdkxb8p\DCv2\DCv2.exe    N/A      |
|    0   N/A  N/A     18720    C+G   ...oft OneDrive\OneDrive.exe    N/A      |
|    0   N/A  N/A     18792    C+G   ...8wekyb3d8bbwe\Cortana.exe    N/A      |
|    0   N/A  N/A     18932    C+G   ...4__8j3eq9eme6ctt\IGCC.exe    N/A      |
|    0   N/A  N/A     20864    C+G   ...518.78\msedgewebview2.exe    N/A      |
|    0   N/A  N/A     23236    C+G   ...icrosoft VS Code\Code.exe    N/A      |
|    0   N/A  N/A     23564    C+G   ...y\ShellExperienceHost.exe    N/A      |
|    0   N/A  N/A     24192    C+G   C:\Windows\explorer.exe         N/A      |
|    0   N/A  N/A     25488    C+G   ...oot\Office16\POWERPNT.EXE    N/A      |
|    0   N/A  N/A     25784    C+G   ...IA GeForce Experience.exe    N/A      |
|    0   N/A  N/A     27900    C+G   ...dkxb8p\Gamebar_Widget.exe    N/A      |
|    0   N/A  N/A     28508    C+G   ...a0\XboxGameBarSpotify.exe    N/A      |
+-----------------------------------------------------------------------------+

nvcc -v:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Sun_Feb_14_22:08:44_Pacific_Standard_Time_2021
Cuda compilation tools, release 11.2, V11.2.152
Build cuda_11.2.r11.2/compiler.29618528_0

Have I missed anything during the installation process. I am aware that there are many other posts on this topic, but solutions haven’t been successful.

@N048,

image

As per above reference you are using CUDA 12.0. According to Tested build configurations, Tensorflow 2.10/2.11 are compatible with CUDA 11.2

Thank you!

I thought that aswell. However, that I read that the CUDA Version in the Screenshot when running nvidia-smi shows the driver version and not the installed CUDA version.

It seems multiple CUDA versions are installed in the same environment.

Please uninstall CUDA 12.0 and try again.

I have only installed CUDA 11.2. CUDA 12 only shows up because it is the version of the driver on my GPU. Or might I be confusing myself.

you don’t actually have to uninstall CUDA 12.0 what you need to do is go into your environment variable, open PATH, and rearrange the order in which you find the variables. The first variables in PATH are what are used by CUDA. This saves a lot of time if you are switching between versions.

Verify the change worked by restarting Command Prompt and typing nvcc --version