Comments (9)
i have restarted pc and ubuntu multiple times.
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.60.01 Driver Version: 551.76 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 3090 On | 00000000:01:00.0 On | N/A |
| 30% 54C P0 121W / 350W | 1642MiB / 24576MiB | 4% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| No running processes found |
+-----------------------------------------------------------------------------------------+
from tensorflow.
@jeanswiegers If TF is not recognizing GPU, then could you please verify the build compatibility by running the following in your WSL environment;
import tensorflow as tf
print(tf.test.is_built_with_cuda())
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!
from tensorflow.
@jeanswiegers If TF is not recognizing GPU, then could you please verify the build compatibility by running the following in your WSL environment;
import tensorflow as tf print(tf.test.is_built_with_cuda())
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.
from tensorflow.
@jeanswiegers Thank you for your quick response!
Simply restarting your WSL instance (wsl --shutdown
) or your entire computer can resolve environment variable issues. Could you please try this once. If the issue continues then, please use nvidia-smi within your WSL terminal to confirm your RTX3090 is recognized by the NVIDIA drivers. If not, there might be an issue with the driver installation itself.
Thank you!
from tensorflow.
I managed to get it working by installing the latest supported CUDA version (12.3) Ubuntu runfile stated on tensorflows website.
Only running
pip install tensorflow[with-cuda]
doesn't work.
from tensorflow.
Working
from tensorflow.
Are you satisfied with the resolution of your issue?
Yes
No
from tensorflow.
@jeanswiegers Glad it worked fine for you.
Thank you!
from tensorflow.
Almost final and automated fix below
-
Where I found the resolution
- TF 2.16.1 Fails to work with GPUs
- Solution proposed by "sh-shahrokhi", improved by "ChristofKaufmann"
- See specially Comment by COntributor
- Related Issues
- GPU not detected on WSL2, where I have post some comments
- Tensorflow WSL GPU CUDA recognition issue RTX3090
- Once gain: tf.2.16.1 fails to recognize GPUs
- Other mention on social media
- TF 2.16.1 Fails to work with GPUs
-
Exact solution
- Temporary fix (after activating environment in which Tensorflow 2.16.1 is installed)
export NVIDIA_DIR=$(dirname $(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))) export LD_LIBRARY_PATH=$(echo ${NVIDIA_DIR}/*/lib/ | sed -r 's/\s+/:/g')${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
- Automating the variable set/unset process with Anaconda (one-time setup)
- Activate your environement in which TF 2.16.1 is installed
- Two files to be created in "anaconda3/envs/<ENV_NAME>/etc/conda"
- anaconda3/envs/<ENV_NAME>/etc/conda/activate.d/env_vars.sh
#!/bin/sh export NVIDIA_DIR=$(dirname $(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))) export LD_LIBRARY_PATH=$(echo ${NVIDIA_DIR}/*/lib/ | sed -r 's/\s+/:/g')${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
- anaconda3/envs/<ENV_NAME>/etc/conda/deactivate.d/env_vars.sh
#!/bin/sh unset NVIDIA_DIR unset LD_LIBRARY_PATH
- Official documentation to do this via conda.io
- Stack-overflow question where I got this Set environment vars when activating conda env
- Temporary fix (after activating environment in which Tensorflow 2.16.1 is installed)
-
What else helped me
from tensorflow.
Related Issues (20)
- Model.add_loss is not documented HOT 1
- Cannot use @TaskAction annotation on method IncrementalTask.taskAction$gradle_core() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method. HOT 4
- ERROR: @local_config_cuda//:enable_cuda :: Error loading option @local_config_cuda//:enable_cuda: 'NoneType' value has no field or method 'replace' HOT 2
- A checker is needed for inputs of Conv layers. HOT 1
- [Bazel CI] Bazel build error: Target '//tensorflow/tools/pip_package:build_pip_package' contains an error with Bazel@HEAD HOT 1
- TensorFlow lite compilation error under Ubuntu 22.04.4 LTS HOT 2
- Upgrading TFLite package (from TF 2.8 to Play Services) HOT 1
- Unknown: JIT Compilation Failed
- ValueError: Invalid dtype: str768 HOT 1
- Infinity loop when try to save model with input_signatures on funtion decorator HOT 3
- Tensorflow does not recognice GPU no matter what HOT 2
- __dict__ error when saving a model using tf.saved_model.save(model, modelSavedPath)
- softplus on zero values is incorrect HOT 3
- We integrate tensorflow movenet with our webapp, and it stopped working (it worked two weeks ago) with the following error message, what can be the possible reasons and how to fix it? HOT 2
- Tensorflow TF ops - CPU Factory not registered HOT 8
- Complex dtype input for keras layer in tf2.16+ HOT 1
- [Android x86_64] [TFLite] `Fatal signal 11 (SIGSEGV), code 128 (SI_KERNEL), fault addr 0x0` crash from `libtensorflowlite.so` HOT 1
- [DOCS] Missing complex input for Round op HOT 1
- Ensemble provides either correct or (the same) incorrect inference results HOT 2
- tf.keras.utils.plot_model doesn't work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorflow.