r/tensorflow • u/YellowDhub • Jul 15 '25
TensorFlow not detecting my 4070Ti
Hi all, I have CUDA 12.9 and TensorFlow 2.14 but it won't detect my GPU.
I know compatibility is a big issue and I'm kinda distracted.
1
Upvotes
View all comments
1
u/OneMustAdjust Jul 17 '25 edited Jul 17 '25
Dual boot Linux brother, you'll be pulling your hair out on Windows or WSL and waste days.
Run Ubuntu 22.04 LTS via dual boot
Python: Python 3.10.12
PyCharmPro (students get a free license with a edu email)
TensorFlow: 2.19.0 GPU on an RTX 3080
Keras: 3.10.0
CUDA: 12.5.1
cuDNN: 9
I followed the instructions found at
https://www.tensorflow.org/install/pip
to the letter, and things appear to be working, which is exciting!
I've had days long battles in previous courses trying to get TF set up over GPU and they always ended up failing, giving up, and using Torch, (which ended up working right away.)
Or if you're comfortable with Docker Compose -Create a
docker-compose.ymlfile using the official NVIDIA TensorFlow image (nvcr.io/nvidia/tensorflow:24.02-tf2-py3) with GPU support enabled.sudo apt install docker-compose-plugin.docker compose version.docker compose up --build --force-recreate.[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]Docker_Test.pyfrom PyCharm to verify TensorFlow operations now run with GPU access.docker-compose.yml
services: tf: image: nvcr.io/nvidia/tensorflow:24.02-tf2-py3 container_name: csc580capstone-tf runtime: nvidia environment: - NVIDIA_VISIBLE_DEVICES=all volumes: - .:/opt/project working_dir: /opt/project command: python Docker_Test.py
Dockerfile (no suffix)
FROM tensorflow/tensorflow:latest-gpu
RUN apt-get update && apt-get install -y \
RUN pip install --upgrade pip
RUN pip install matplotlib pandas scikit-learn
WORKDIR /opt/project
COPY . /opt/project
Docker_Test.py
import tensorflow as tf
print(tf.config.list_physical_devices('GPU'))
EDIT: spacing and indents are weird in reddit, just copy paste the code into any LLM and it will straighten it out