// Upgrade pip
pip install --upgrade pip
//install venv
sudo apt install python3.11-venv
// Python Local Environment
python3 -m venv .venv
source .venv/bin/activate
//Install tensorflow
python3 -m pip install tensorflow[and-cuda]
// Checks if nvidia driver is installed
nvidia-smi
// Install Cuda
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-3
// Verify the installation:
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
// Check paths
echo $CUDNN_PATH # should exist and give a good path
ls $CUDNN_PATH # should contain stuff like a lib subdir with libcudnn .so files
echo $LD_LIBRARY_PATH # should exist and contain CUDNN_PATH
// fix paths
export CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.file)"))
export LD_LIBRARY_PATH=${CUDNN_PATH}/lib