Please check if running as root
echo "high" > /sys/class/drm/card0/device/power_dpm_force_performance_level
fixes the flashing.
Ubuntu 18.04 is too old to auto-detect the nvidia gpu but this doesn’t matter, the driver is installed and running fine.
You can now continue to configure the nvidia gpu to be used:
https://forums.developer.nvidia.com/t/nvidia-xconfig-doesnt-do-what-i-want-it-to-nor-does-nvidia-settings/107883/7?u=generix