I had many driver installed I my virtual machine , so It was actually the reason why I was having the error.
To fix it I had first to remove all driver I have installed before using :
-
sudo apt-get purge nvidia-*
-
sudo apt-get update
-sudo apt-get autoremove
After that I when a head and installed the latest version of it nvidia driver:
I did :
-
apt search nvidia-driver
to get the latest version of the driver After getting the latest version I installed it with :sudo apt install nvidia-driver-390
And after installing it I rebooted my machine and checked with :
nvidia-smi
And tata:
The results :
Ressources :
https://www.cyberciti.biz/faq/ubuntu-linux-install-nvidia-driver-latest-proprietary-driver/