Open the Software & Updates panel. Under Additional Drivers, select the correct driver and apply.
Next, install the drivers for CUDA support: apt install nvidia-cuda-dev nvidia-cuda-toolkit
apt install nvidia-cuda-dev nvidia-cuda-toolkit