Cannot switch from intel gpu to nvidia gpu on ubuntu 20.04

Hi, i am having trouble with my nivida graphics card. for some reason when i type NVIDIA-smi i get this error:

NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

i have purged NVIDIA and reinstalled the recommended graphics driver. when i do prime select query, it returns NVIDIA. However when i check on settings>about, it says that the graphics card in use is the integrated intel graphics card. for some reason prime select has not changed the GPU to Nvidia.

Help would really be appreciated very much!

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