I used this code to install the Nvidia driver:
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt install nvidia-384
Problem: There are many versions available. How do I choose the right one? Is there any way to auto-detect the right version based on the hardware?