Skip to content
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

Problem with Tensorflow 2.16.1 and gpu #64525

Closed
Altrastorique opened this issue Mar 26, 2024 · 8 comments
Closed

Problem with Tensorflow 2.16.1 and gpu #64525

Altrastorique opened this issue Mar 26, 2024 · 8 comments
Assignees
Labels
comp:gpu GPU related issues stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author TF 2.16 type:build/install Build and install issues

Comments

@Altrastorique
Copy link

Issue type

Build/Install

Have you reproduced the bug with TensorFlow Nightly?

No

Source

source

TensorFlow version

2.16.1

Custom code

Yes

OS platform and distribution

Windows 11

Mobile device

No response

Python version

3.12 and also tried with 3.9

Bazel version

No response

GCC/compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

RTX 3070

Current behavior?

Hello, I was trying to make TensorFlow work with my GPU, but the CUDA installation crashed every time. So I tried using Anaconda, but they don't have CUDA version 12.3 and CuDNN version 8.9. So I succeeded using the Anaconda PowerShell and downloading TensorFlow-GPU 2.10.
I heard that TensorFlow-GPU is an old version we should not use.
Does someone have any idea which could help me?
Thank you very much!

Standalone code to reproduce the issue

(base) C:\Users\User>conda create -n tensorflow python=3.12
(base) C:\Users\User>conda activate tensorflow
(tensorflow) C:\Users\User>conda install -c conda-forge cudatoolkit=12.3 cudnn=8.9

Relevant log output

Channels:
 - conda-forge
 - defaults
Platform: win-64
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - cudatoolkit=12.3*

Current channels:

  - https://conda.anaconda.org/conda-forge
  - defaults

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.
@google-ml-butler google-ml-butler bot added the type:build/install Build and install issues label Mar 26, 2024
@SuryanarayanaY
Copy link
Collaborator

Hi @Altrastorique ,

After creating Conda environment please use pip to install TF package. For GPU package please use pip install tensorflow[and-cuda] that will install all the required compatible cuda/cudnn packages. Please ensure compatible cuda driver installed manually. Please check and come back if still having problem. Thanks.

@SuryanarayanaY SuryanarayanaY added comp:gpu GPU related issues TF 2.16 stat:awaiting response Status - Awaiting response from author labels Mar 27, 2024
@Altrastorique
Copy link
Author

Okay, but when I run this in the annaconda power shell I have this: WARNING: tensorflow 2.13.1 does not provide the extra 'and-cuda'
So when I run this code:

import tensorflow as tf
tf.test.gpu_device_name()

print(tf.config.list_physical_devices('GPU'))

I have: [ ]

The same happen when I run it in my terminal.

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Status - Awaiting response from author label Mar 27, 2024
@SuryanarayanaY
Copy link
Collaborator

Okay, but when I run this in the annaconda power shell I have this: WARNING: tensorflow 2.13.1 does not provide the extra 'and-cuda'

The 'and-cuda' package introduced in TF2.14 onwards. You are trying for Tf2.13v as warning states.Please upgrade to higher version.

@SuryanarayanaY SuryanarayanaY added the stat:awaiting response Status - Awaiting response from author label Apr 3, 2024
@Altrastorique
Copy link
Author

Altrastorique commented Apr 5, 2024

The tensorflow version >2.13 are not available on the anaconda powershell. So I had to use the terminal. But I still have this error when installing tensorflow[and-cuda]

ERROR: Could not find a version that satisfies the requirement nvidia-nccl-cu12==2.19.3; extra == "and-cuda" (from tensorflow[and-cuda]) (from versions: 0.0.1.dev5)
ERROR: No matching distribution found for nvidia-nccl-cu12==2.19.3; extra == "and-cuda"

When trying the 2.14 version I had this:

py -m pip install tensorflow==2.14
ERROR: Could not find a version that satisfies the requirement tensorflow==2.14 (from versions: 2.16.0rc0, 2.16.1)
ERROR: No matching distribution found for tensorflow==2.14

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Status - Awaiting response from author label Apr 5, 2024
@SuryanarayanaY
Copy link
Collaborator

Hi @Altrastorique ,

If you are using Windows OS cuda package is not available for windows from TF2.11 onwards. Please refer the caution on same in documentation.

If you want to use GPU then you need to install WSL2. Please refer the instructions for wsl2 here.

@SuryanarayanaY SuryanarayanaY added the stat:awaiting response Status - Awaiting response from author label Apr 18, 2024
Copy link

This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Apr 26, 2024
Copy link

github-actions bot commented May 3, 2024

This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further.

@github-actions github-actions bot closed this as completed May 3, 2024
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:gpu GPU related issues stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author TF 2.16 type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

2 participants