Harvey
Harvey

Reputation: 209

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

I'm trying to run stylegan2 on Google Colab but with all the files on my Drive and avoiding using !git clone from the github of stylegan2. Here is my code on the specific cell:

%tensorflow_version 1.x
%cd /content/drive/My Drive/stylegan2-master/
!nvcc test_nvcc.cu -o test_nvcc -run
print('Tensorflow version: {}'.format(tf.__version__) )
!nvidia-smi -L
print('GPU Identified at: {}'.format(tf.test.gpu_device_name()))

And the result:

/content/drive/My Drive/stylegan2-master CPU says hello. cudaErrorNoDevice: no CUDA-capable device is detected Tensorflow version: 1.15.2 NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

GPU Identified at:

Why can't I get the GPU? I am new in the field so I may be missing something very simple, but still can't find out on the internet the answer.

Upvotes: 7

Views: 19562

Answers (2)

Richa Baranwal
Richa Baranwal

Reputation: 11

For the error - /bin/bash: line 1: nvidia: command not found

convert runtime type as GPU (T4 GPU) and then use this code instead:

!nvidia-smi 2>&1 | grep -i "cuda"

!nvidia-smi

It helps me solving the error.

Upvotes: 1

Francesco Alongi
Francesco Alongi

Reputation: 521

You have to enable the GPU first in the Notebook settings.

You can easily do it by clicking on Edit > Notebook settings and selecting GPU as hardware accelerator.

That should be it.

Upvotes: 23

Related Questions