tensorflow / tensorflow/tensorflow

After installing miniconda on Ubuntu under WSL2 and using pip to install TensorFlow in the virtual environment, I can't get GPU acceleration to work properly.

Open
#117,916 0 comments 0 reactions 1 assignee View on GitHub

@Venkat6871 is already working on this.

Since May 8, 2026.

2.21.0 comp:gpu type:bug
Dominant language
C++
Stars
200k
Forks
76.9k
Avg merge
2d 3h
Merged PRs (30d)
433

Description

Issue type

Bug

Have you reproduced the bug with TensorFlow Nightly?

Yes

Source

binary

TensorFlow version

2.21.0

Custom code

Yes

OS platform and distribution

ubuntu 24.04

Mobile device

No response

Python version

3.13

Bazel version

No response

GCC/compiler version

No response

CUDA/cuDNN version

CUDA12.9 / CUDNN 9.21

GPU model and memory

RTX5080 16GB

Current behavior?

The graphics card driver is already installed locally. After using the official installation command and checking that all dependencies are installed, when I try to test if the GPU is working with a test command, it says it's not working and shows an empty list because the GPU wasn't found.

Standalone code to reproduce the issue
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
Relevant log output
Installing collected packages: namex, libclang, flatbuffers, wrapt, urllib3, typing_extensions, termcolor, six, pygments, protobuf, opt_einsum, nvidia-nvjitlink-cu12, nvidia-nccl-cu12, nvidia-curand-cu12, nvidia-cuda-runtime-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-nvcc-cu12, nvidia-cuda-cupti-cu12, numpy, mdurl, idna, gast, charset_normalizer, certifi, absl-py, requests, optree, nvidia-cusparse-cu12, nvidia-cufft-cu12, nvidia-cublas-cu12, ml_dtypes, markdown-it-py, h5py, grpcio, google_pasta, astunparse, rich, nvidia-cusolver-cu12, nvidia-cudnn-cu12, keras, tensorflow
Successfully installed absl-py-2.4.0 astunparse-1.6.3 certifi-2026.4.22 charset_normalizer-3.4.7 flatbuffers-25.12.19 gast-0.7.0 google_pasta-0.2.0 grpcio-1.80.0 h5py-3.14.0 idna-3.13 keras-3.14.1 libclang-18.1.1 markdown-it-py-4.2.0 mdurl-0.1.2 ml_dtypes-0.5.4 namex-0.1.0 numpy-2.4.4 nvidia-cublas-cu12-12.9.2.10 nvidia-cuda-cupti-cu12-12.9.79 nvidia-cuda-nvcc-cu12-12.9.86 nvidia-cuda-nvrtc-cu12-12.9.86 nvidia-cuda-runtime-cu12-12.9.79 nvidia-cudnn-cu12-9.21.1.3 nvidia-cufft-cu12-11.4.1.4 nvidia-curand-cu12-10.3.10.19 nvidia-cusolver-cu12-11.7.5.82 nvidia-cusparse-cu12-12.5.10.65 nvidia-nccl-cu12-2.30.4 nvidia-nvjitlink-cu12-12.9.86 opt_einsum-3.4.0 optree-0.19.1 protobuf-7.34.1 pygments-2.20.0 requests-2.33.1 rich-15.0.0 six-1.17.0 tensorflow-2.21.0 termcolor-3.3.0 typing_extensions-4.15.0 urllib3-2.7.0 wrapt-2.1.2
(tf) chenruhai@DESKTOP-335AIA8:~$ pip list
Package                  Version
------------------------ ----------
absl-py                  2.4.0
astunparse               1.6.3
certifi                  2026.4.22
charset-normalizer       3.4.7
flatbuffers              25.12.19
gast                     0.7.0
google-pasta             0.2.0
grpcio                   1.80.0
h5py                     3.14.0
idna                     3.13
keras                    3.14.1
libclang                 18.1.1
markdown-it-py           4.2.0
mdurl                    0.1.2
ml_dtypes                0.5.4
namex                    0.1.0
numpy                    2.4.4
nvidia-cublas-cu12       12.9.2.10
nvidia-cuda-cupti-cu12   12.9.79
nvidia-cuda-nvcc-cu12    12.9.86
nvidia-cuda-nvrtc-cu12   12.9.86
nvidia-cuda-runtime-cu12 12.9.79
nvidia-cudnn-cu12        9.21.1.3
nvidia-cufft-cu12        11.4.1.4
nvidia-curand-cu12       10.3.10.19
nvidia-cusolver-cu12     11.7.5.82
nvidia-cusparse-cu12     12.5.10.65
nvidia-nccl-cu12         2.30.4
nvidia-nvjitlink-cu12    12.9.86
opt_einsum               3.4.0
optree                   0.19.1
packaging                26.0
pip                      26.1.1
protobuf                 7.34.1
Pygments                 2.20.0
requests                 2.33.1
rich                     15.0.0
setuptools               82.0.1
six                      1.17.0
tensorflow               2.21.0
termcolor                3.3.0
typing_extensions        4.15.0
urllib3                  2.7.0
wheel                    0.46.3
wrapt                    2.1.2
(tf) chenruhai@DESKTOP-335AIA8:~$ python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1778219068.730368    3366 port.cc:153] 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`.
I0000 00:00:1778219068.766687    3366 cpu_feature_guard.cc:227] 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.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1778219069.451472    3366 port.cc:153] 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`.
W0000 00:00:1778219069.730267    3366 gpu_device.cc:2365] 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...
[]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.