Method 1
1. Install a special ubuntu system starting from HP website
https://support.hp.com/hk-en/drivers/selfservice/hp-zbook-studio-15.6-inch-g8-mobile-workstation-pc/2100677682
Choose ubuntu, download the iso file, put it into a usb by using Balena Etcher
, flush it into your laptop
2. After you get into the ubuntu20.04 system
You could use nvidia-smi
to check the GPU memory.
3. Install tensorflow by using anaconda
Tensorflow has a tutorial in here: https://www.tensorflow.org/install/pip
It's something like this:
conda install -c conda-forge cudatoolkit=11.8.0
python3 -m pip install nvidia-cudnn-cu11==8.6.0.163 tensorflow==2.12.*
mkdir -p $CONDA_PREFIX/etc/conda/activate.d
echo 'CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/:$CUDNN_PATH/lib' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
source $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
# Verify install:
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
4. Install pytorch
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
https://pytorch.org/get-started/locally/
Verify it:
import torch
print(torch.cuda.is_available())
Method 2
1. Upgrade HP bios
You could directly use online bios update to update your bios fireware.
Reboot -> F2 -> Esc -> Set up WiFi -> reboot -> F10 -> update bios in a online way
Or you could use Windows system to do the update:
https://support.hp.com/us-en/document/ish_3894564-1633733-16
2. Switch to integrated graphics only mode
In popos, you can do it in right-top-corner icon, power settings.
In ubuntu, you can do it in nvidia-settings
-> profile-settings
-> use integrated graphics
reboot
3. Use gcc-12
which gcc
# if gcc is not gcc-12, then do the following
sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/gcc-12 /usr/bin/gcc
4. Install nvidia special driver for your special gpu version
For me, it's GeForce RTX 3070 Mobile
.
From the nvidia driver download page, you could download a file like NVIDIA-Linux-x86_64-525.105.17.run
https://www.nvidia.com/download/index.aspx?lang=en-us
Then you do the following:
sudo chmod 777 NVIDIA-Linux-x86_64-525.105.17.run
sudo ./NVIDIA-Linux-x86_64-525.105.17.run
5. Switch back to nvidia graphics only mode
reboot
Now, you should be able to use nvidia-smi
to see the real-time gpu memory info
6. Install anaconda
https://conda.io/projects/conda/en/latest/user-guide/install/linux.html#installing-on-linux
Download a file look like Anaconda3-2023.03-Linux-x86_64.sh
sudo chmod 777 Anaconda3-2023.03-Linux-x86_64.sh
sudo ./Anaconda3-2023.03-Linux-x86_64.sh
7. Install cuda by using conda
Now, open a new terminal window
Then, try to install tensorflow by using script from tensorflow official documentation:
https://www.tensorflow.org/install/pip
conda install -c conda-forge cudatoolkit=11.8.0
python3 -m pip install nvidia-cudnn-cu11==8.6.0.163 tensorflow==2.12.*
mkdir -p $CONDA_PREFIX/etc/conda/activate.d
echo 'CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/:$CUDNN_PATH/lib' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
source $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
# Verify install:
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
8. Done
author: @yingshaoxo