Step-by-Step Guide to Installing TensorFlow with GPU on RTX 4060 Without Crashes

Aman AnandAman Anand
2 min read

Author: Aman

Date: June 3rd, 2025


⚙️ Overview

I set up TensorFlow with GPU support for my skin cancer detection and classification project. Here’s a clear and simple list of the exact steps I followed to get everything running smoothly with my NVIDIA RTX 4060 Laptop GPU.


✅ Step 1: Update NVIDIA GPU Driver

Make sure your graphics drivers are up to date. You can download the latest drivers here:
👉 NVIDIA Driver Downloads


🛠️ Step 2: Install Visual Studio with C++

Download Visual Studio Community Edition and during installation, select all C++ related components, including MSBuild. TensorFlow needs the C++ build tools present.

👉 Download Visual Studio


⚡ Step 3: Install CUDA Toolkit 11.5

Download CUDA 11.5 Toolkit from:
👉 CUDA 11.5.1 Download

Install it with default settings.


💾 Step 4: Install cuDNN for CUDA 11.5

Download cuDNN 8.3.1 from NVIDIA:
👉 cuDNN Archive

Extract the ZIP file and copy the contents into your CUDA directory (e.g., C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.5), inside the corresponding bin, include, and lib folders.


🧪 Step 5: Install Anaconda or Miniconda

You can use either. I used Miniconda.
👉 Anaconda Download


📦 Step 6: Create and Activate Conda Environment

conda create -n tensorflow python=3.9 -y
conda activate tensorflow

📝 Step 7: Install Jupyter and Set Up Kernel

Install Jupyter:

conda install -y jupyter

Then register the kernel:

pip install ipykernel
python -m ipykernel install --user --name=tensorflow --display-name "Python (tensorflow)"

⚙️ Step 8: Install TensorFlow and Fix NumPy

Install the compatible TensorFlow version:

pip install tensorflow==2.10.0

Then fix the NumPy issue: if numpy>2.xx.x

pip install numpy==1.24.3

🧪 Step 9: Verify GPU is Working

import tensorflow as tf
print(tf.__version__)
print(tf.config.list_physical_devices('GPU'))

Optional full device info:

from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())

If your output shows NVIDIA GeForce RTX 4060, you're good to go.


✅ Done

That’s it. You’re ready to train TensorFlow models with GPU support using your RTX 4060. Everything was tested and works smoothly in Jupyter notebooks.

Reference: I used this video as a guide.


#tensorflow #gpu #cuda #cudnn #python #setup #machinelearning #rtx4060 #hashnode

1
Subscribe to my newsletter

Read articles from Aman Anand directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Aman Anand
Aman Anand