The statement from the TensorFlow website implies that starting from TensorFlow 2.11 version, running TensorFlow on native Windows with GPU support is no longer officially supported. Instead, one needs to use Windows Subsystem for Linux 2 (WSL2) to install and run TensorFlow with GPU support on Windows.
WSL2 is a compatibility layer for running Linux binary executables natively on Windows 10 and Windows Server 2019. It provides a Linux kernel interface developed by Microsoft. By utilizing WSL2, users can access a Linux environment directly on their Windows system.
To install TensorFlow with GPU support using WSL2, you can follow these steps:
-
Install Windows Subsystem for Linux (WSL2):
- Open PowerShell as Administrator and run the following command:
wsl --install.
- Restart your computer when the installation is complete.
-
Install a Linux distribution (e.g., Ubuntu) on WSL2:
- Open Microsoft Store and search for "Ubuntu".
- Select a version of Ubuntu and click "Install".
- Launch the installed Ubuntu app.
-
Update the Ubuntu system:
-
Install GPU drivers on WSL2:
- Follow the official documentation from your GPU manufacturer to install the compatible GPU drivers on the WSL2 Ubuntu environment.
-
Install CUDA Toolkit on WSL2:
- Visit the NVIDIA CUDA Toolkit download page (https://developer.nvidia.com/cuda-downloads) and select your Linux distribution (Ubuntu).
- Follow the instructions to download and install the appropriate CUDA Toolkit version for your GPU on WSL2.
-
Install cuDNN on WSL2:
- Visit the NVIDIA cuDNN download page (https://developer.nvidia.com/cudnn) and download the cuDNN Library for Linux.
- Follow the instructions to install cuDNN on your WSL2 environment.
-
Install Python and TensorFlow on WSL2:
-
Set up X server (optional) for graphical support (GUI) in WSL2:
With these steps completed, you should have TensorFlow with GPU support installed on Windows through WSL2. You can now proceed to develop and run TensorFlow applications using the Linux environment provided by WSL2.