Setup TensorFlow in Windows Server with GPU

Summary

This is how to set up TensorFlow on a server with a compatible GPU.

Body

1. Create a conda environment

Open windows menu and find & click on "Anaconda Powershell Prompt (Anaconda3)":

Anaconda Powershell Prompt seelcted in the windows start menu

Create a new conda environment named tf with the following command.

conda create --name tf python=3.9

Anaconda Powershell Prompt showing the conda create command being executed

You can deactivate and activate it with the following commands.

conda deactivate
conda activate tf

Make sure it is activated for the rest of the installation.

Anaconda Powershell Prompt showing the activate tf command executing

 

2. GPU setup

Then install the CUDA, cuDNN with conda.

conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0

Anaconda Command Prompt excuting the conda install command

 

3. Install TensorFlow

TensorFlow requires a recent version of pip, so upgrade your pip installation to be sure you're running the latest version.

python -m pip install --upgrade pip

Anaconda command prompt excuting the python pip upgrade command

Then, install TensorFlow with pip.

Note: Do not install TensorFlow with conda. It may not have the latest stable version. pip is recommended since TensorFlow is only officially released to PyPI.

# Anything above 2.10 is not supported on the GPU on Windows Native
pip install "tensorflow<2.11"

Python Command Prompt executing the tensorflow installation command

Python Command Prompt executing the tensorflow installation command

If still for more than 2 min without returning to the prompt, hit ENTER.

Anaconda Command Prompt excuting the tensorflow command

4. Verify the installation

python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"

Anaconda Command Prompt executing the installation verification prompt

If a list of GPU devices is returned, you've installed TensorFlow successfully.

Details

Details

Article ID: 1912
Created
Thu 12/4/25 12:46 PM
Modified
Thu 12/18/25 8:30 AM

Related Services / Offerings

Related Services / Offerings (1)

Submit a General Support request using the "Purdue IT Request" button to the right. The Purdue IT Service Desk will examine, follow-up and route as needed.