I run all scripts in this https://forums.developer.nvidia.com/t/nvidia-smi-not-working-on-dual-booted-ubuntu-20-04/262433 =)))) so I don't know exactly which script solves the problem
but i think, what you need is installing drivers for your machine sudo ubuntu-drivers autoinstall
and than rebooting