C.W.K.
Stream
Lesson 07 of 07 · published

Installing TF 2.21 — CPU, NVIDIA GPU, Apple Silicon, Docker

~12 min · install, gpu, cuda, metal

Level 0Level 0
0 XP0/78 lessons0/17 achievements
0/100 XP to next level100 XP to go0% complete

Get your environment right once and stop fighting it

Half the TensorFlow questions on Stack Overflow are install issues. The reason: TF interacts with CUDA, cuDNN, Metal, and Python ABI versions in ways that differ on every platform. Get a clean install once and save yourself hours.

As of TensorFlow 2.21.0 (March 2026): minimum Python is 3.10, TensorBoard ships separately, and the GPU install is bundled with CUDA 12.3 + cuDNN 8.9.7 inside the wheel.

Windows native + GPU is dead. Native Windows builds support GPU only up through TF 2.10. For TF 2.11+ with NVIDIA GPU on Windows, install inside WSL2 and follow the Linux instructions. Native Windows + TF 2.21 = CPU only.

Code

CPU 설치 — 모든 플랫폼·bash
python3 -m venv venv-tf
source venv-tf/bin/activate     # Windows: venv-tf\Scripts\activate
pip install --upgrade pip
pip install tensorflow
python -c "import tensorflow as tf; print(tf.__version__)"
Linux / WSL2 + NVIDIA GPU·bash
pip install 'tensorflow[and-cuda]'
# Bundles CUDA 12.3 + cuDNN 8.9.7 with the wheel.
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
Apple Silicon (M1/M2/M3/M4) — Metal·bash
python3 -m venv venv-metal
source venv-metal/bin/activate
pip install --upgrade pip
pip install tensorflow tensorflow-metal
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
# Expect: [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
Docker — 어디서나 작동·bash
docker pull tensorflow/tensorflow:latest
docker run -it -p 8888:8888 tensorflow/tensorflow:latest-jupyter

# Linux + NVIDIA GPU
docker run --gpus all -it tensorflow/tensorflow:latest-gpu

# TF 2.21+에선 TensorBoard 따로 설치 잊지 말기
pip install tensorboard

External links

Exercise

Install TF 2.21 on your machine using the path that matches your hardware. Run tf.config.list_physical_devices() and confirm the device list looks right. If you have an NVIDIA GPU and it shows only CPU, you've hit the most common install bug — diagnose it now, before you start the next track.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.