I found I can determine if VT-D / IOMMU is enabled using this code:
if compgen -G "/sys/kernel/iommu_groups/*/devices/*" > /dev/null; then
echo "AMD's IOMMU / Intel's VT-D is enabled in the BIOS/UEFI."
else
echo "AMD's IOMMU / Intel's VT-D is not enabled in the BIOS/UEFI"
fi
But in the case where it is not enabled I have not been able to find a way to check if the system supports the option in the first place.
I am aware that Intel/AMD have documented which of their CPUs support VT-D / IOMMU, but I want to find out if the whole system (motherboard+UEFI/BIOS+CPU+chipset) would support this feature because my notebook for instance has a CPU that supports it, but there is no option in the UEFI to enable it.