The problem is that Ubuntu 18.04 doesn’t really support your AMD/Nvidia combo. You should rather use 21.04 and up which supports your system ootb.
If you really can’t upgrade, you’ll have to install a newer kernel, firmware files and config manually
Kernel:
You will need 4 packages
linux-headers-XX
linux-headers-XX-generic
linux-image-unsigned-XX-generic
linux-modules-XX-generic
from https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.10.75/
Firmware:
fetch all files that begin with green_sardine from
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/amdgpu
via the ‘plain’ link and put them into /lib/firmware/amdgpu
Then run
sudo update-initramfs -u
After reboot, llvm should be gone in the system info and AMDgpu should be shown.
Afterwards, check this on hoe to get the nvidia gpu working together with the amdgpu:
https://forums.developer.nvidia.com/t/nvidia-xconfig-doesnt-do-what-i-want-it-to-nor-does-nvidia-settings/107883/7?u=generix