tensorflow: cuDNN, cuFFT, and cuBLAS Errors
Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
Yes
Source
source
TensorFlow version
GIT_VERSION:v2.14.0-rc1-21-g4dacf3f368e VERSION:2.14.0
Custom code
No
OS platform and distribution
WSL2 Linux Ubuntu 22
Mobile device
No response
Python version
3.10, but I can try different versions
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
CUDA version: 11.8, cuDNN version: 8.7
GPU model and memory
NVIDIA Geforce GTX 1660 Ti, 8GB Memory
Current behavior?
When I run the GPU test from the TensorFlow install instructions, I get several errors and warnings. I don’t care about the NUMA stuff, but the first 3 errors are that TensorFlow was not able to load cuDNN. I would really like to be able to use it to speed up training some RNNs and FFNNs. I do get my GPU in the list of physical devices, so I can still train, but not as fast as with cuDNN.
Standalone code to reproduce the issue
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
Relevant log output
2023-10-09 13:36:23.355516: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2023-10-09 13:36:23.355674: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2023-10-09 13:36:23.355933: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2023-10-09 13:36:23.413225: I tensorflow/core/platform/cpu_feature_guard.cc:182] 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.
2023-10-09 13:36:25.872586: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:880] could not open file to read NUMA node: /sys/bus/pci/devices/0000:01:00.0/numa_node
Your kernel may have been built without NUMA support.
2023-10-09 13:36:25.916952: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:880] could not open file to read NUMA node: /sys/bus/pci/devices/0000:01:00.0/numa_node
Your kernel may have been built without NUMA support.
2023-10-09 13:36:25.917025: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:880] could not open file to read NUMA node: /sys/bus/pci/devices/0000:01:00.0/numa_node
Your kernel may have been built without NUMA support.
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 144
- Comments: 203 (13 by maintainers)
Commits related to this issue
- tensorflow unreferenced thus removed this causes the errors noted in https://github.com/tensorflow/tensorflow/issues/62075 but armory doesn't in fact use them — committed to twosixlabs/armory-library by deleted user 3 years ago
- feat: Add pillow and create different environment files for windows and wsl - "environment-win" holds is a working env with Tensorflow 2.15 but only with CPU support (as GPU on bare Windows is not su... — committed to Korred/unet-pp by Korred 3 years ago
- feat: Add pillow and create different environment files for windows and wsl - "environment-win" holds a working env with Tensorflow 2.15 but only with CPU support (as GPU on bare Windows is not suppo... — committed to Korred/unet-pp by Korred 3 years ago
- This PR downgrades harmless duplicate cuDNN, cuBLAS, and cuFFT factory registration logs from INFO to VLOG(1), fully silencing them during normal usage. Upstream already reduced these from ERROR to I... — committed to anushikhov/tensorflow by anushikhov 2 years ago
Hi @Ke293-x2Ek-Qe-7-aE-B ,
Starting from TF2.14 tensorflow provides CUDA package which can install all the cuDNN,cuFFT and cubLas libraries.
You can use
pip install tensorflow[and-cuda]command for that.Please try this command let us know if it helps. Thankyou!
@SuryanarayanaY I tried several times, reinstalling Ubuntu, but it still doesn’t work.
Hello,
I’m experiencing the same issue, even though I meticulously followed all the instructions for setting up CUDA 11.8 and CuDNN 8.7. The error messages I’m encountering are as follows:
Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered. Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered. Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered.
I’ve tried this with different versions of Python. Surprisingly, when I used Python 3.11, TensorFlow 2.13 was installed without these errors. However, when I used Python 3.10 or 3.9, I ended up with TensorFlow 2.14 and the aforementioned errors.
I’ve come across information suggesting that I may not need to manually install CUDA and CuDNN, as [and-cuda] should handle the installation of these components automatically.
Could someone please guide me on the correct approach to resolve this issue? I’ve tried various methods, but unfortunately, none of them have yielded a working solution.
P.S. I’m using conda in WSL 2 on Windows 11.
I also have the same issue, and this seems not to be due to cuda environment as I rebulid cuda and cudnn to make them suit for tf-2.14.0.
This is log out I find:
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"2023-10-11 18:21:57.387396: I tensorflow/core/util/port.cc:111] 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 variableTF_ENABLE_ONEDNN_OPTS=0. 2023-10-11 18:21:57.415774: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered 2023-10-11 18:21:57.415847: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered 2023-10-11 18:21:57.415877: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered 2023-10-11 18:21:57.421400: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. 2023-10-11 18:21:58.155058: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT 2023-10-11 18:21:59.113217: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:880] could not open file to read NUMA node: /sys/bus/pci/devices/0000:65:00.0/numa_node Your kernel may have been built without NUMA support. 2023-10-11 18:21:59.152044: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:880] could not open file to read NUMA node: /sys/bus/pci/devices/0000:65:00.0/numa_node Your kernel may have been built without NUMA support. 2023-10-11 18:21:59.152153: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:880] could not open file to read NUMA node: /sys/bus/pci/devices/0000:65:00.0/numa_node Your kernel may have been built without NUMA support. [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]i’m dying, this issue kills my career
@picobyte I am already using a venv. And system packages are not related to this bug 😉. Tensorflow is linking twice with the same object; not my system packages.
It turns out that
bazel-out/k8-opt-exec-50AE0418/bin/tensorflow/compiler/xla/stream_executor/cuda/libcudnn_plugin.pic.locontains the duplicated symbol(s):and
bazel aquery 'mnemonic("CppLink", //tensorflow:libtensorflow_cc.so.2.14.0)' --output=textshows that it linked with libtensorflow_cc.After a whole-day-long investigation, I found the following comment in
tensorflow/BUILD:So, apparently
ddunleavyalready knew about this bug.Many people still have this issue, but I am closing it since Tensorflow works with these errors. I am using the NVIDIA NGC Tensorflow container (
docker pull nvcr.io/nvidia/tensorflow:24.07-tf2-py3) instead of going through the long process of installing the correct versions of drivers, Python, and Tensorflow.It’s been five months, yet the problem remains.
Spent 5 hours on this, the register factory issue was resolved with:
$ pip uninstall tensorflow $ python3 -m pip install tf-nightly[and-cuda]
But first verify that you’ve setup cuDNN and nvcc correctly first, otherwise its not tf’s problem.
Now I have the NUMA issue remaining, gonna go figure that out next.
@ymodak This piece of shit is still unresolved in the latest version. WHY and HOW could you remove the bug label !? That DOES NOT MAKE SENSE! HOW INSANE! I am confused if your test cases have covered this issue or not?
tensorflow真的很难安装,我尝试了很多2.x版本以及python版本,在调用gpu时,总是报各种错误(之前讨论中的错误我都遇到过),如果要做深度学习,pytroch确实更容易使用,非深度学习scikit-learn足矣
TLDR: These errors appear in
2.16.2, you have to downgrade to2.16.1, reason unknown, google is not providing any help on this.I am having the same issue as FaisalAlj above, on Windows 10 with the same versions of CUDA and CuDNN. The package
tensorflow[and-cuda]is not found by pip. I’ve tried different versions of python and tensorflow without success. In my case I’m using virtualenv rather than conda.Edit 1: I appear to be able to install
tensorflow[and-cuda]as long as I use quotes around the package, like:pip install "tensorflow[and-cuda]".Edit 2: I still appear to be getting these messages however, so I’m not sure I’ve installed things correctly.
Yeah. But I just found that when I downgrade to 2.13.0 version, errors in register won’t appear again. It looks like this:
(TF) ephys3@ZhouLab-Ephy3:~$ python3 -c "import tensorrt as trt;import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"Although I haven’t figured out how to solve NUMA node error, I found some clues from another issue (as I operated all above in WSL Ubuntu). This bug seems not to be significant as explaination from NVIDIA forums . So I guess errors in register might have something with the latest version and errors in NUMA might be caused by OS enviroment. Hope this information would help some guys.
Indeed, Tensorflow==2.16.1 works even for me. I tried to read the source for tensorflow==2.17.0 and 2.16.1 to at least try find out what might be the issue. The following is what I found out:
The executed piece of code for registering the plugin
cuFFTis located at the file:tensorflow-2.16.1/third_party/xla/xla/stream_executor/cuda/cuda_fft.c(you can change the tensorflow version # appropriately) and reproduced below:This function should be responsible for creating the
PluginRegistryobject defined in the file:tensorflow-2.16.1/third_party/xla/xla/stream_executor/plugin_registry.h. This object has a very important comment, reproduced below:The class should be a Singleton, and even if it has been registered once an attempt to register it again will fail but tensorflow should work as expected.
And below is the function responsible for the registration, from the file:
tensorflow-2.16.1/third_party/xla/xla/stream_executor/plugin_registry.cc:I am not entirely sure as to when and where the very first object of
cuFFT PluginRegisteryis created for tensorflow to display this error. I believe there has to be a point from runningimport tensorflowand calling the above functioninitialize_cufftwhere thePluginRegistryobject is created and since it must be aSingleton, hence the error. I hope someone can elaborate further on this, or provide better clarity.Tensorflow==2.13.1 without any issue. (Environment: Ubuntu 22.04.2 LTS WSL2, cuda=11.8, cndnn=8.9.6)
python3.11 -m pip install tensorflow==2.13.1
I installed 2.15 with no luck, then tried 2.14.1 with errors still there.
CUDA
https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_network
Installation Instructions:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb sudo dpkg -i cuda-keyring_1.0-1_all.deb sudo apt-get update sudo apt-get -y install cuda-11-8
setup your paths:
echo ‘export PATH=/usr/local/cuda-11.8/bin:$PATH’ >> ~/.bashrc echo ‘export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH’ >> ~/.bashrc source ~/.bashrc sudo ldconfig
cnDNN
https://developer.nvidia.com/rdp/cudnn-download
Download cuDNN v8.9.6 (November 1st, 2023), for CUDA 11.x
wget https://developer.nvidia.com/downloads/compute/cudnn/secure/8.9.6/local_installers/11.x/cudnn-linux-x86_64-8.9.6.50_cuda11-archive.tar.xz
sudo tar -xvf cudnn-linux-x86_64-8.9.6.50_cuda11-archive.tar.xz sudo mv cudnn-linux-x86_64-8.9.6.50_cuda11-archive cuda
copy the following files into the cuda toolkit directory:
sudo cp -P cuda/include/cudnn*.h /usr/local/cuda-11.8/include sudo cp -P cuda/lib/libcudnn* /usr/local/cuda-11.8/lib64/ sudo chmod a+r /usr/local/cuda-11.8/lib64/libcudnn*
Verify Installation:
nvidia-smi nvcc -V
For NUMBA
Add these lines at the end of your .bashrc:
export LD_LIBRARY_PATH=“/usr/lib/wsl/lib/” export NUMBA_CUDA_DRIVER=“/usr/lib/wsl/lib/libcuda.so.1”
I have found a workaround that seems to be effective. By installing the following specific versions of TensorFlow and its related packages, the issue is resolved:
These versions work well together and avoid the problem encountered with TensorFlow 2.14.0.
According to @Romeo-CC in https://github.com/tensorflow/tensorflow/issues/62002#issuecomment-1800718221: The issue was present in versions 2.10 and 2.11, resolved in 2.12, but reemerged in 2.14.
Re-opening as this does need to be fixed
Hi Tensorflow maintainers, can this please be fixed? It works works with GPU for 2.13 but not for 2.15 any longer (I haven’t tried 2.14, but it others above seem to have done it):
Installing 2.16.0-dev20231212 with
tf-nightly[and-cuda]resolved the issue for me.PS The error is still also in 2.15.
@ymodak How is it not a bug when you add the same global variable to two different shared libraries that have to be used together in most of the cases, causing the same initialization code to be run twice? This was never the intention, and is inherently wrong. The fact that it seems like there is no ill effect coming from it, because the second call will be ignored, does not convince me it should be left like this: there might be other duplicates. We’re talking clearly about the “Initialization order fiasco” here or something of the same level of badness.
I have a first try at solving this that should hopefully land soon, waiting on review internally. Sorry for the delay here
Name: tensorflow Version: 2.17.0
I have similar problem, on WSL Ubuntu 22.04, with pip installed tensorflow :
I don’t understand why the bug label was removed, even though it’s still a bug and an error. Not to mention, there’s a new version of TensorFlow 2.15 where it should have been fixed there, but it remains unresolved.
Can confirm, with tf 2.15, and a complete system update, these errors persist, but do not appear to limit any functionality or performance.
The message suggests the factories in question are already present:
Attempting to register factory for plugin cuDNN when one has already been registeredtf 2.15, followed install guide on wsl2, same situation
@AthiemoneZero Because it still does output a GPU device at the bottom of the log, I am training on GPU, just without cuDNN. It will be slower, but it is better than nothing or training on CPU.
I think registration error still exists.
If I install tensorflow[and-cuda] >= 2.17.0, tensorflow can identify the GPU but output the registration errors If I install tensorflow[and-cuda] == 2.16.1 as previous comments suggested, the error disappears but tensorflow CANNOT identify the GPU
It is frustrating to use tensorflow nowadays because official documentation/guideline/example never works smoothly to be honest. Users need to find patches and tips scattered across the internet.
When 2.15.X didn’t work, tensorflow 2.16.1 (without CUDA) solved this issue for me. Python3.10, CUDA driver 12.2, Cuda Toolkit 12.1, cuDNN 8.9.5.
pip uninstall tensorflow && pip install tf-nightly[and-cuda]How many people are on the TF team? Is their backlog too big to address this?
I think this is bigger than a particular bug in TF. TF seems to have other problems that people have reported but have not been addressed. This raises the question of whether users should still use TF for their projects. I mean, they do not seem to be that involved in this and we cannot force Google to do anything. On the other hand, we cannot spend hours and hours of our time finding workarounds on code that we do not understand.
Agreed, but who’s going to fix it? LOL. Google seems to have more profitable things to do
Can confirm it works with 2.16.1. For those who have to resort to using 2.9.0 workaround (some of my packages are limited to 2.15), use python <= 3.10 to install it.
It finally worked, with Tensorflow 2.16.1 (upgrade to lastest) >
pip install --upgrade tensorflowI did delve deeper into this and found the following: Tensorflow 2.14.0 is initializing the above three libraries two times. The first time from here:
and
The second time from here:
and
Got similar error on Ubuntu 22.04.3 LTS 😦
tensorflow==2.15.0 ===>>> cuda-12.* (cuda-12.1, cuda-12.2) tensorflow==2.14.0 ===>>> cuda-12.* (cuda-12.1, cuda-12.2) tensorflow==2.13.0 ===>>> cuda-11.* (cuda-11.8 etc) Installing the corresponding tensorflow based on cuda version can solve this problem
@DeepCowProductions I understand your call for calm. However it is shocking that @CarloWood has done all the hard work tracking this down and
tensorflowteam won’t fix for 1 year +.Spurious errors are dev time sinks.
The gpu image is definitely broken. Now I am not going to expend hours tracking down if broken registration or something else. Here is nice and clean image startup from
2.11.0Here is the current mess:
You are right, what a shame, I gave up and went to Rust.
Works perfectly: You can check with what version works your tensorflow with this code
@Romeo-CC @CarloWood Sorry for the misunderstanding. I see that this issue is related to
type:build/installand as per issue triage workflow we limit the type label usage to one label per issue for internal tracking purposes hence I removedtype:buglabel . Having said that I acknowledge that this is an active problem and have notified the relevant team.Same issue
Just a quick heads up @maulberto3, when you use
nvidia-smi, the CUDA version you see in the top right corner is the highest version of CUDA compatible with your Nvidia driver, and not actually the currently installed CUDA version. Good to know since that’s confused me in the past.CollapseCleaner – Runtime Memory & Driver Integration Profiler
Hi @mazurkin @AthiemoneZero @sandeepnjk and TF maintainers,
We’ve worked extensively with TensorFlow 2.14–2.19 across WSL2, Docker, and bare-metal Linux. This class of error messages — “Unable to register cuDNN/cuBLAS/cuFFT factory” — is non-fatal but critical to understand.
They indicate redundant plugin registration, not failure to load CUDA libraries.
Why It Happens:
Multiple dynamic linkage points in Docker/WSL2 may register the same CUDA backend multiple times.
TensorFlow 2.14+ includes [pre-bundled CUDA libraries](https://www.tensorflow.org/install/pip#gpu), so installing both
tensorflow[and-cuda]and system-wide cuDNN causes collisions.Most environments that combine:
pip install tensorflow[and-cuda]What You Can Do:
Option A — Minimal Clean Install:
Then:
That should remove all duplicate factories and ensure only TensorFlow’s internal linkage is active.
Option B — Use CollapseCleaner for runtime sanity checks
We’ve built a runtime profiling tool — CollapseCleaner — that detects:
This provides a programmatic check to ensure you’re not leaking GPU contexts after cuDNN/cuBLAS factory collisions.
🧪 Want Live CLI Output?
See our test logs + performance mitigation examples here: 🔗 [CollapseCleaner – The Invisible Leak Draining Billions from AI](https://www.linkedin.com/pulse/invisible-leak-draining-billions-from-ai-until-now-hussein-shtia-h20rf/)
We’d be happy to help you validate whether your build is triggering functional slowdowns (not just warnings), and we’re preparing a Docker-safe diagnostic layer for open testing.
I have no idea what those warnings mean, there are other reported issues on this GitHub repo that explain it, but I’m lazy to read that. But I do know that even if those warnings appear, the GPU is recognized and you can train models with it. I don’t know if other functionalities are the ones that are affected by those or if they mean performance issues.
I was running into this issue within the tensorflow image: tensorflow/tensorflow:2.18.0-gpu-jupyter Doing
pip install tensorflow[with-cuda]within the container fixed the problem and starts training from GPU nowIndeed, the errors have nothing to do with TensorFlow functionality as per my observation trying to read the source code, they are produced because a class PluginRegistry responsible for plugins is a Singleton class and trying to instantiate it more than once should raise an error. Maybe this should have just been a warning message, i don’t know, but an error is more appropriate to raise when instantiating a Singleton class more than once.
Maybe the TensorFlow team must ensure that the PluginRegistry class is only instantiated once and only once. As it stands, they look ugly, easily become a psychological fallback to blame when things don’t work properly and not very welcoming to newcomers.
@rivershah Hey - I thought that my analysis had been long buried under the hundreds of messages that came after from (clueless) people reporting on trying something random. Good to see that at least one person paid attention 😉.
It’s a bug, they will never fix it, just do this:
https://github.com/tensorflow/tensorflow/issues/62075#issuecomment-2327739010
Any explanation for why these “ERRORS” emerged in the importing phase ? It’s a grinding issue across 8 VERSIONS from tf-2.10 to tf-2.17. It should have been tackled.
Worked for me! Thanks so much! Now to fix the other errors! 😅
NUMA non zero problem can be solved this way
01:00.0 VGA compatible controller: NVIDIA Corporation TU106 [GeForce RTX 2060 12GB] (rev a1) 01:00.1 Audio device: NVIDIA Corporation TU106 High Definition Audio Controller (rev a1) The first line shows the address of the VGA-compatible device, NVIDIA Geforce, as 01:00 . Each one will be different, so let’s change this part carefully. 2. Check and change NUMA setting values If you run ls with this path /sys/bus/pci/devicecs/, you can see the following list: ls /sys/bus/pci/devices/
0000:00:00.0 0000:00:06.0 0000:00:15.0 0000:00:1c.0 0000:00:1f.3 0000:00:1f.6 0000:02:00.0 0000:00:01.0 0000:00:14.0 0000:00:16.0 0000:00:1d.0 0000:00:1f.4 0000:01:00.0 0000:00:02.0 0000:00:14.2 0000:00:17.0 0000:00:1f.0 0000:00:1f.5 0000:01:00.1 01:00.0 checked above is visible. However, 0000: is attached in front. 3. Check if it is connected. cat /sys/bus/pci/devices/0000:01:00.0/numa_node
-1
1 means no connection, and 0 means connected. 4. Fix it with the command below. sudo echo 0 | sudo tee -a /sys/bus/pci/devices/0000:01:00.0/numa_node
0
This is not working either.
Same error on Ubuntu 22.04 LTS Install in WSL2 / Windows 11. Has anyone found solution to this?
Same issue here on both WSL2 and Ubuntu.
Hi @Ke293-x2Ek-Qe-7-aE-B ,
I have checked the installation on colab(linx environment) and observed same logs as per attached gist.
These logs seems generated from XLA compiler but GPU is able to detectable. Similar issue #62002 and already bought to Engineering team attention.
CC: @learning-to-play
@Ke293-x2Ek-Qe-7-aE-B Apologize for my misunderstanding. I did the same in installing cuda toolkit as what you described above before I went directly to debug tf_gpu. I made sure my gpu and cuda could perform well as I have tried another task smoothly using cuda but without tf. What I concerned is some dependencies of tf have to be pre-installed in a conda env and this might be treated by [and-cuda] (my naive guess
@AthiemoneZero Usually, I would install the CUDA toolkit according to these instructions (here), then install cuDNN according to these instructions (here). I installed CUDA toolkit version 11.8 and cuDNN version 8.7, because they are the latest supported by TensorFlow, according to their support table here. I guess using [and-cuda] installs all of that for you.
@Ke293-x2Ek-Qe-7-aE-B I rebuilt all in an independent conda environment as TF. My steps were to create a TF env with
python 3.9.8and triedpython3 -m pip install tensorflow[and-cuda] --useraccording to instruction. Following these I triedpython3 -m pip install tensorflow[and-cuda]=2.13.0 --userand found it solved some bug.Install this : pip install tf-nightly
This works absolutely fine with no error flags !
Sadly the only version that doesn’t show those warnings is
2.16.1as far as I’ve tested.tensorflowteam, your docker containers that you publish show this in yourgcpenvironment. Maybe try and fix?These apparently-meaningless errors are still present in TF 2.18 despite having Hermetic Cuda (which sounds like it should solve the problem), but I have found a nuclear option to silence ALL output from TensorFlow, along with everything else. Note that this will also silence valid error messages, but those should be recoverable from exceptions.
The solution is this context manager: https://github.com/benchopt/benchopt/blob/main/benchopt/utils/stream_redirection.py and it works by redefining stdout and stderr to be a temporary file, and since TensorFlow errors eventually make their way to these streams, this catches them.
Note that this will also suppress any output from your program inside that manager unless you specifically write to the duplicated stdout/stderr file descriptor. See page 97 in Kerrisk’s The Linux Programming Interface for details on the dup and dup2 syscalls.
Thank you @acampove . Can you tell me how to specify 2.16.1 with:
Edit: For now, I am just installing
tensorflow==2.16.1and providing my own CUDA, cuDNN, and XLA_FLAGS:Same issue on Red Hat 9 Linux. My NVIDA version is 535.146.02. I installed
tensorflow[and-cuda]yesterday. The tensorflow version I got is 2.17.0. My GPU isNVIDIA GeForce RTX 4080.Same errors here: ubuntu 22.04 x86_64 nvidia driver: 550.90.07 CUDA toolkit: 12.4.131 tensorflow: 2.14
It drives me nuts. I have tried everything.
I am a normal user of Tensorflow, not a Google employee. Like you said, Google is not fixing these errors, so I offered an alternative that worked for me.
I don’t think closing issues because some alternative works is not a good idea. So many compatibility, warning, bugs exist consistently in each release of tf… Well no wonder Google is switching to JAX
After several days of upgrading and downgrading libraries I found a combination that works for me
More specifically I installed CUDA by
sudo apt-get install cudaI downloaded and installed the deb fileslibcudnn8-dev_8.9.7.29-1+cuda12.2_amd64.debandlibcudnn8_8.9.7.29-1+cuda12.2_amd64.debfrom https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ and installed tensorflow bypip install tensorflow==2.16.1(without [and-cuda])My OS is Linux Mint 21.1 Cinnamon and my python version 3.10.12
I have been using Docker to run TF on WSL. It turns out that even the latest Docker image has the error messages too. So I downloaded an earlier image and it does not have such error messages.
@belitskiy I had a theory about how to fix this that I submitted, but my attempted fix ended up holding up release. I probably don’t have time to tackle this one at the moment unfortunately
Thank you for your comment @qnlzgl . I have attempted to fix the issue in various ways, but none have proven successful for me.
works for me, thank you very much
This has fixed the issue for me. For people dealing with errors using JAX and encounter
cuSolver ran into an error. This fixes it.Tried with tf-nightly-2.16.0.dev20231219 Still the same issues Python 3.10.12 | wsl2 Ubuntu 18.04.5 LTS | windows11
@ddunl Since I’m not using master, I had to change the diff a little. I applied the attached patch to 2.14.0. After that everything still compiled and the duplicated registration of the plugins vanished from my ‘hello-world’ test program.
HOWEVER - verification with objdump shows that now neither
libtensorflow_framework.so.2.14.0norlibtensorflow_cc.so.2.14.0contains the global registration variable anymore!Is there a way to test if things still really work? Cause I have the feeling that now the plugins aren’t registered at all.
Great, when trying to attach
cuda_plugins.patchI get the message: We don’t support that file type.Try again with GIF, JPEG, JPG, MOV, MP4, PNG, SVG, WEBM, CPUPROFILE, CSV, DMP, DOCX, FODG, FODP, FODS, FODT, GZ, JSON, JSONC, LOG, MD, ODF, ODG, ODP, ODS, ODT, PATCH, PDF, PPTX, TGZ, TXT, XLS, XLSX or ZIP.
I’ll paste it here, losing all required white-space requirements no doubt, but perhaps enough for inspection:
Looking at a binary distribution (of Arch linux) of version 2.13.0, we note that
/usr/lib/libtensorflow_cc.so.2.13.0does NOT have the symbolgoogle_initializer_module_register_cudnn(while/usr/lib/libtensorflow_framework.so.2.13.0does).The regression is therefore that in version 2.14.0 the file
tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.ccmistakenly is linked to the target//tensorflow:libtensorflow_cc.so, while it should only end up in libtensorflow_framework.so.@Ke293-x2Ek-Qe-7-aE-B You’re welcomed. BTW, I also followed the instruction to configure development including suitable version of bazel and clang-16, just before all my operation digging into conda env.