Ubuntu 18.04.3 - NVIDIA driver fails, CUDA not possible


I have a dual boot (Ubuntu 18.04.3 and Windows 10) laptop Acer Aspire 7 series, with an NVIDIA GeForce GTX 1050 (2 GB GDDR5 Dedicated VRAM). Every time I install an NVIDIA driver (because I also want to install Cuda and run some deep learning algorithms), my laptop stops working. It doesn’t stop/freeze immediately after the installation. It stops/freezes after I reboot.

Also, immediately after the installation, I tried to verify that the installation was completed correctly, by typing nvidia-smi in my terminal. I got the error message that “NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver”.

I tried to switch off secure boot and add nomodeset in my kernel parameters, but it wasn’t successful.