After spending more than 5 hours, i found this easy solution:
-To verify that the system has a CUDA-capable GPU, run the following command:
lspci | grep -i NVIDIA
You will see output similar to the following example (showing an NVIDIA Tesla K80/M60 card):
-Disabling the nouveau driver:
sudo...