NVIDIA not running properly on ubuntu 18.04

The drivers seem to be installed correctly, but when I run

lspci | grep VGA

It reveals that it is running Intel internal graphics:

00:02.0 VGA compatible controller: Intel Corporation Device 3e9b

When I run

prime-select query

it says “nvidia”. Running “nvidia-settings”, it has no problem communicating with the GPU.

Running “dpkg -l | grep nvidia” gives me:

ii libnvidia-cfg1-450:amd64 450.57-0ubuntu0~0.18.04.2 amd64 NVIDIA binary OpenGL/GLX configuration library
ii libnvidia-common-390 390.138-0ubuntu0.18.04.1 all Shared files used by the NVIDIA libraries
ii libnvidia-common-440 440.100-0ubuntu0.18.04.1 all Shared files used by the NVIDIA libraries
ii libnvidia-common-450 450.57-0ubuntu0~0.18.04.2 all Shared files used by the NVIDIA libraries
rc libnvidia-compute-390:amd64 390.138-0ubuntu0.18.04.1 amd64 NVIDIA libcompute package
rc libnvidia-compute-390:i386 390.138-0ubuntu0.18.04.1 i386 NVIDIA libcompute package
rc libnvidia-compute-440:amd64 440.100-0ubuntu0.18.04.1 amd64 NVIDIA libcompute package
ii libnvidia-compute-450:amd64 450.57-0ubuntu0~0.18.04.2 amd64 NVIDIA libcompute package
ii libnvidia-compute-450:i386 450.57-0ubuntu0~0.18.04.2 i386 NVIDIA libcompute package
ii libnvidia-decode-450:amd64 450.57-0ubuntu0~0.18.04.2 amd64 NVIDIA Video Decoding runtime libraries
ii libnvidia-decode-450:i386 450.57-0ubuntu0~0.18.04.2 i386 NVIDIA Video Decoding runtime libraries
ii libnvidia-encode-450:amd64 450.57-0ubuntu0~0.18.04.2 amd64 NVENC Video Encoding runtime library
ii libnvidia-encode-450:i386 450.57-0ubuntu0~0.18.04.2 i386 NVENC Video Encoding runtime library
ii libnvidia-extra-450:amd64 450.57-0ubuntu0~0.18.04.2 amd64 Extra libraries for the NVIDIA driver
ii libnvidia-fbc1-450:amd64 450.57-0ubuntu0~0.18.04.2 amd64 NVIDIA OpenGL-based Framebuffer Capture runtime library
ii libnvidia-fbc1-450:i386 450.57-0ubuntu0~0.18.04.2 i386 NVIDIA OpenGL-based Framebuffer Capture runtime library
ii libnvidia-gl-450:amd64 450.57-0ubuntu0~0.18.04.2 amd64 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii libnvidia-gl-450:i386 450.57-0ubuntu0~0.18.04.2 i386 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii libnvidia-ifr1-450:amd64 450.57-0ubuntu0~0.18.04.2 amd64 NVIDIA OpenGL-based Inband Frame Readback runtime library
ii libnvidia-ifr1-450:i386 450.57-0ubuntu0~0.18.04.2 i386 NVIDIA OpenGL-based Inband Frame Readback runtime library
ii nvidia-compute-utils-450 450.57-0ubuntu0~0.18.04.2 amd64 NVIDIA compute utilities
ii nvidia-dkms-450 450.57-0ubuntu0~0.18.04.2 amd64 NVIDIA DKMS package
ii nvidia-driver-450 450.57-0ubuntu0~0.18.04.2 amd64 NVIDIA driver metapackage
ii nvidia-kernel-common-450 450.57-0ubuntu0~0.18.04.2 amd64 Shared files used with the kernel module
ii nvidia-kernel-source-450 450.57-0ubuntu0~0.18.04.2 amd64 NVIDIA kernel source package
ii nvidia-prime 0.8.8.2 all Tools to enable NVIDIA’s Prime
ii nvidia-settings 440.82-0ubuntu0.18.04.1 amd64 Tool for configuring the NVIDIA graphics driver
ii nvidia-utils-450 450.57-0ubuntu0~0.18.04.2 amd64 NVIDIA driver support binaries
ii xserver-xorg-video-nvidia-450 450.57-0ubuntu0~0.18.04.2 amd64 NVIDIA binary Xorg driver

running “nvidia-smi” results in:

Failed to initialize NVML: Driver/library version mismatch

I am running Ubuntu 18.04.5 LTS. Running “ubuntu-drivers devices” results in:

== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001C8Csv00001028sd0000087Cbc03sc02i00
vendor : NVIDIA Corporation
model : GP107M [GeForce GTX 1050 Ti Mobile]
driver : nvidia-driver-415 - third-party free
driver : nvidia-driver-440-server - distro non-free
driver : nvidia-driver-440 - distro non-free
driver : nvidia-driver-418-server - distro non-free
driver : nvidia-driver-450 - third-party free recommended
driver : nvidia-driver-435 - distro non-free
driver : nvidia-driver-410 - third-party free
driver : nvidia-driver-390 - distro non-free
driver : xserver-xorg-video-nouveau - distro free builtin

I have searched for several hours online for a solution, but none of them works for me so far. Please provide a step-by-step guide with terminal commands, I am no ubuntu expert.

Thanks!