I have tried alot to install tf-gpu but I always get into errors!
So after a lot of brainstorming here is few steps for you to install tensorflow-gpu
Windows 10 or 11 Only...
1. Install Nvidia Driver
a. Download Automatic Driver Updates File form here :-
https:
It will automatically finds best suitable driver for your system
2. Install wsl(Windows Subsystem for linux) on your windows 10 or greater
a. open powershell or cmd in adminstrator
b. wsl --install
c. Enter credentials and usernames(Imp to remember)
d. Reboot System
3. Install Anaconda
a. Open cmd as user not adminstrator and type wsl
b. type "curl https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh --output anaconda.sh"
c. type "bash anaconda.sh" in wsl
d. Enter and say yes to all like[Do you approve the license terms? [yes|no], Do you wish the installer to initialize Anaconda3]
e. activate installation by type "source ~/.bashrc"
f. Now you will get (base)
4. Environment and Cuda, Cudnn(GO on pasting every line in (base))
a. conda create --name tf python=3.9
b. conda activate tf
c. nvidia-smi (To Check GPU )
d. conda install -c conda-forge cudatoolkit=11.8.0
e. pip install nvidia-cudnn-cu11==8.6.0.163
f. mkdir -p $CONDA_PREFIX/etc/conda/activate.d
g. CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))
h. echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/:$CUDNN_PATH/lib' > $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
5. Installing Tensorflow in env
a. pip install --upgrade pip
b. pip install tensorflow==2.12.*
c. python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))" (To Check GPU)
6. Install Jupyter in base and not in environment
a. conda install -y jupyter
Problems:-
a. No GPU detected after running 5. and c. command:-
Rerun 4. g. and h. every time when you launch or activate environment i.e tf