New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tensorflow WSL GPU CUDA recognition issue RTX3090 #63948
Comments
@jeanswiegers If TF is not recognizing GPU, then could you please verify the build compatibility by running the following in your WSL environment;
This should output True. If it's False, you might need to reinstall TensorFlow with GPU support. For more information on WSL with GPU support please refer to https://www.tensorflow.org/install/pip. The TensorFlow version needs to be compatible with your CUDA version. Thank you! |
Hi Sushreebarsa, thanks for your help. It does return True in my environment. |
@jeanswiegers Thank you for your quick response! |
i have restarted pc and ubuntu multiple times.
|
I managed to get it working by installing the latest supported CUDA version (12.3) Ubuntu runfile stated on tensorflows website. Only running |
Working |
@jeanswiegers Glad it worked fine for you. |
Almost final and automated fix below
|
tf_env.txt
Issue type
Build/Install
Have you reproduced the bug with TensorFlow Nightly?
No
Source
source
TensorFlow version
2.16.1
Custom code
No
OS platform and distribution
Linux Ubuntu 20.04.6
Mobile device
No response
Python version
3.11.7
Bazel version
No response
GCC/compiler version
11.2.0
CUDA/cuDNN version
8.6
GPU model and memory
NVIDIA GeForce RTX 3090
Current behavior?
I installed Tensorflow using gpu install guide for WSL as follows:
wsl --install
sudo apt update
sudo apt upgrade
sudo apt install python3-pip
cd Desktop
Download anaconda linux
https://www.anaconda.com/download#downloads
bash Anaconda3-2024.02-1-Linux-x86_64.sh
~/anaconda3/bin/conda init bash
~/anaconda3/bin/conda init zsh
conda create --name tf-gpu python==3.11
conda activate tf-gpu
pip install --upgrade pip
pip install tensorflow[and-cuda]
Pytorch is working perfectly in WSL with Cuda enabled. Tensorflow is not recognizing my GPU.
nvidia-smi output:
nvcc --version output:
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))" output:
/usr/local/cuda-11.8/extras/demo_suite/deviceQuery output:
ENVs set:
Standalone code to reproduce the issue
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
Relevant log output
The text was updated successfully, but these errors were encountered: