Ubuntu freezing and problem in nvidia driver installation

Sir/Madam
I have tried installing nvidia driver using all the options given in the link : https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-18-04-bionic-beaver-linux

But,the problem isn’t solved. There are basically two problems :
“After installation when i type nvidia-smi an error is displayed : NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.”

Annd once i reboot, then a black screen appears where i am not even able to switch to ctrl+alt+f1/f2/f3…/f6. So, then usually i log-in via recovery mode through the root and purge all the nvidia files to successfull login.

Since, I don’t have any kind of USB, i am not able to save the bug report.I tried running nvidia-bug-report.sh via root but then i didn’t get to know how to access it as i was unable to login to the system.

version: 440.33.01 (nvidia-version)

uname -r
4.15.0-88-generic (Kernel Version)
ubuntu 18.04 is installed in my system and GPU is nvidia 1050Ti

If you have internet connection, you can use pastebinit to upload it from console.

  • install pastebinit (sudo apt install pastebinit)
  • unzip logfile (gunzip nvidia-bug-report.log.gz)
  • upload logfile (pastebinit -i nvidia-bug-report.log)
  • note down and post the url you’re given

How do we ensure internet connection while in recovery mode(I am using root via recovery mode as I am unable to login to the system after installing the nvidia driver).
I have the internet connection but unable to access it in recovery mode(root)

Ok, I was able to connect to the internet.
Here’s the url ,I was provided :
http://paste.ubuntu.com/p/dTkxPrWCS6/

Here’s the snapshot of the same url :

You have a driver mismatch of kernel modules 440.33 and GL files 440.59, probably from an ealier .run installer.
Please download a .run installer

wget https://http.download.nvidia.com/XFree86/Linux-x86_64/440.82/NVIDIA-Linux-x86_64-440.82.run

make it executable

chmod ogu+x NVIDIA-Linux-x86_64-440.82.run

and run it with uninstall option

sudo ./NVIDIA-Linux-x86_64-440.82.run --uninstall

afterwards, purge and reinstall the repo driver from an empty directory

mkdir test
cd test
sudo apt remove nvidia*
sudo apt install nvidia-driver-440
cd ..
rmdir test

No, it didn’t work. Again, the problem were same.
I am attaching the link of bug report :

http://paste.ubuntu.com/p/YP63mnxjsF/

Then you broke your system beyond repair. Please reinstall Ubuntu, then install the nvidia driver using Ubuntu’s Software&Updates application. Never use a .run installer unless you know exactly what you do.

Ok then please guide me through all the steps required to install the nvidia driver after reinstalling ubuntu so that I don’t break the system again.

  • install Ubuntu 18.04
  • upgrade to latest HWE stack:
    sudo apt-get install --install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04
  • do a full system update:
    sudo apt update
    sudo apt upgrade
  • start ‘Software&Updates’ application
  • choose nvidia 440 driver from additional drivers