在conda安装完成cuda、cudnn、tensorflow-gpu之后,运行测试代码,出现:
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的问题,没找到。
接着命令行输入:nvidia-smi竟然不能打印出GPU 的信息。
问题原因:2080 GPU 的显卡驱动默认是没安装的,需要手动安装,解决过程:
Using graphics-drivers
PPA repository allows us to install bleeding edge Nvidia beta drivers at the risk of unstable system.
ppa:graphics-drivers/ppa
repository into your system: $ sudo add-apt-repository ppa:graphics-drivers/ppa $ sudo apt update
$ ubuntu-drivers devices == /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 == modalias : pci:v000010DEd00001C03sv00001043sd000085ABbc03sc00i00 vendor : NVIDIA Corporation model : GP106 [GeForce GTX 1060 6GB] driver : nvidia-driver-390 - third-party free driver : nvidia-driver-410 - third-party free recommended driver : nvidia-driver-396 - third-party free driver : xserver-xorg-video-nouveau - distro free builtin
$ sudo ubuntu-drivers autoinstallor selectively using the
apt
command. Example: $ sudo apt install nvidia-410