lspci: Cannot open /sys/bus/pci/devices/38b3:00:00.0/resource: No such file or directory

Last week I was able to detect the gpu device and run tensorflow.

But now it is unable to detect the gpu device.

The errors are shown as follows:

lspci
lspci: Cannot open /sys/bus/pci/devices/38b3:00:00.0/resource: No such file or directory

nvidia-smi
the command window freezes (i.e., does not return anything)

deviceQuery

the command window freezes (i.e., does not return anything)

I am wondering if anyone can help me on this.

Maybe this is owing to you have stopped(deallocated) the Azure VM, and then started VM again. According to [1], the hardware IP(like gpu,cpu) has changed when you stop(deallocated) and then start VM again. But the Ubuntu system hasn’t been updated for new hardware(like gpu, cpu) IP address. Hence, lspci will tell you cannot open some hardware ip address related folder.

[1]https://blogs.technet.microsoft.com/gbanin/2015/04/22/difference-between-the-states-of-azure-virtual-machines-stopped-and-stopped-deallocated/