ubuntu-drivers devices
sudo apt-get install nvidia-driver-510-server
sudo reboot
Error Message
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver.
Make sure that the latest NVIDIA driver is installed and running.
First check with nvidia-driver installed in server
apt --installed list | grep nvidia-driver
Remove nvidia-driver
sudo apt remove nvidia-driver-version_installed_in_server
sudo apt autoremove