ERROR: An error occurred while performing the step: "Building kernel modules" - GP107M [GeForce GTX 1050 Mobile] on Ubuntu 20.04.2, kernel 5.11.0-40-g

Hi does anyone have an issue installing GP107M [GeForce GTX 1050 Mobile] on Ubuntu 20.04.2, kernel 5.11.0-40-generic .

I have tried many drivers like:
nvidia-driver-470 - distro non-free recommended
nvidia-driver-495 - distro non-free
i have tried the recommended by NVidia website 375.20 kernel module error.
I have tried 375,82 and 470.74.

None complete installation, just 470.74 completed but still does not worked, even after reboot.

That message is sent when executing nvidia-smi:
NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

vendor : NVIDIA Corporation
model : GP107M [GeForce GTX 1050 Mobile]

5.11.0-40-generic #44~20.04.2-Ubuntu x86_64 x86_64 x86_64 GNU/Linux

Please run nvidia-bug-report.sh as root and attach the resulting nvidia-bug-report.log.gz file to your post.

My bad, let’s go for the solution:

I did try install from common user and through terminal go to root and install several drivers.

The solution was create a root profile, logout from common user and install the recommended driver 470.82.

To create a root GUI profile its is needed to create a root password.

sudo passwd

then change these two files:

nano /etc/gdm3/custom.conf
under [daemon] insert the following line:

AllowRoot=true

nano /etc/pam.d/gdm-password
comment that line
#auth required pam_succeed_if.so user != root quiet_success

After that logout from common user and login as root in GUI.

Then simple install the version through software-updater and restart machine.

I took a little longer to reply because the last try I break my installation and needed to reinstall ubuntu.

Thank you for the support.