Nvidia-smi shows "no devices were found"

Please check the bios for an option to enable “above 4g decoding” or “large/64bit BARs” and enable it.
Disable CSM and reinstall Ubuntu using EFI-boot.