Score:-1

nvidia-smi not work in zbook studio g8 under ubuntu/linux

cn flag

When I run nvidia-smi, it always shows:

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

I have tried Popos, manjaro, ubuntu 22.04, none of them works. The GPU is only available in Windows, which is bad.

How can I solve it?

I expect to see the real-time memory usage for the GPU

karel avatar
sa flag
Does this answer your question? [Cuda: NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver](https://askubuntu.com/questions/1225886/cuda-nvidia-smi-has-failed-because-it-couldnt-communicate-with-the-nvidia-driv)
yingshao xo avatar
cn flag
@karel I've spent 7 days to solve this problem, you think the answer could get found online???
yingshao xo avatar
cn flag
@karel This is a stupid `bios bug` which can't get solved easily in software level: https://forums.developer.nvidia.com/t/error-nvidia-driver-is-not-loaded-ubuntu-20-04-hp-zbook-studio-g8-rtx3080-ti/221835/7#:~:text=Apr%2020-,This%20was%20a%20bios%20bug,-on%20the%20zbook
karel avatar
sa flag
I retracted my close vote.
Score:0
cn flag

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

guiverc avatar
cn flag
This answer doesn't match the question; the question mentions many off-topic OSes and one Ubuntu release; which isn't 20.04 that is mentioned in this *answer*. For this to be a valid answer, it should match the question details (*one of question or answer needs correction*).
yingshao xo avatar
cn flag
@guiverc Because the stupid HP doesn't provide ubuntu22.04, it only provides 20.04.
guiverc avatar
cn flag
Why not change the question to be about Ubuntu 20.04 LTS then, given that's what your answer relates to. The question & answer need to match, and currently this doesn't answer the question as it assumes the question relates to Ubuntu 20.04 LTS. If you tested it on Ubuntu 22.04 LTS; adjust the wording to say you tested it & it works; but the answer as worded does not answer the asked question as I read it as it's written for a different release.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.