MSI MAG X570 Tomahawk WiFi - Force UEFI to select specific GPU?

I wanted to add a secondary GPU (AMD R5 340X) to my PC (for crtemudriver). My first GPU (GTX 1080) sits in the primary slot PCI_E1.

But no matter where I put the secondary GPU (even tried the x1 slots), the UEFI will always boot from the AMD card and not the NVIDIA anymore which is quite annoying. CSM is disabled. There are no settings that allow me to control which GPU is used as primary.

Is it possible to mod the UEFI to select a specific GPU or is completely dependent on which card initializes first? If it is depending on the card, can the GOP of the AMD card be modified to basically wait longer?

Put the monitor in the card you want to initialize first

I do have my primary monitor connected via the first DP port on the Nvidia card (the primary card), I have a secondary monitor connected via DVI. And then I have a CRT TV connected to the AMD card’s DVI-I port. The AMD card initializes first, always, which is my problem as I don’t want my UEFI shown on the CRT. And unplugging the display is just a hassle and wears out connectors and cables unnecessarily.

I’ve read Gigabyte UEFIs allow choosing the primary card and they even show GOP settings that allow choosing the port to boot from. So I wonder if one can patch the MSI BIOS to unlock these settings as well. Or is this solely a GOP thing and I could use GOPupd to get a newer GOP onto both cards?

Alright so I just downloaded GOPupd to update the GOP on my GTX 1080 which worked but didn’t yield any change in the UEFI. I then used UEFI tool to extract the Setup module and IFR Extract to get a human readable version.

I DID find the menu AMI Graphic Output Protocol Policy which currently only shows my GPU’s data in the BIOS but in the extracted menu I actually found some settings that are permanently suppressed:

	Form FormId: 0x2794, Title: "AMI Graphic Output Protocol Policy"
		Subtitle Prompt: "Unknown Device", Help: "", Flags: 0x0
		End 
		Subtitle Prompt: "Unknown Driver", Help: "", Flags: 0x0
		End 
		SuppressIf 
			True 
			SuppressIf 
				EqIdVal QuestionId: 0x372, Value: 0x1
					Not 
				End 
				OneOf Prompt: "Output Select", Help: "Output Interface", QuestionFlags: 0x4, QuestionId: 0x278B, VarStoreId: 0x1, VarOffset: 0x135, Flags: 0x10, Size: 8, Min: 0x0, Max: 0x0, Step: 0x0
					OneOfOption Option: "Unknown Device" Value: 0, Default, MfgDefault
				End 
			End 
			SuppressIf 
				EqIdVal QuestionId: 0x372, Value: 0x2
					Not 
				End 
				OneOf Prompt: "Output Select", Help: "Output Interface", QuestionFlags: 0x4, QuestionId: 0x278C, VarStoreId: 0x1, VarOffset: 0x135, Flags: 0x10, Size: 8, Min: 0x0, Max: 0x1, Step: 0x0
					OneOfOption Option: "Unknown Device" Value: 0, Default, MfgDefault
					OneOfOption Option: "Unknown Device" Value: 1
				End 
			End 
			SuppressIf 
				EqIdVal QuestionId: 0x372, Value: 0x3
					Not 
				End 
				OneOf Prompt: "Output Select", Help: "Output Interface", QuestionFlags: 0x4, QuestionId: 0x278D, VarStoreId: 0x1, VarOffset: 0x135, Flags: 0x10, Size: 8, Min: 0x0, Max: 0x2, Step: 0x0
					OneOfOption Option: "Unknown Device" Value: 0, Default, MfgDefault
					OneOfOption Option: "Unknown Device" Value: 1
					OneOfOption Option: "Unknown Device" Value: 2
				End 
			End 
			SuppressIf 
				EqIdVal QuestionId: 0x372, Value: 0x4
					Not 
				End 
				OneOf Prompt: "Output Select", Help: "Output Interface", QuestionFlags: 0x4, QuestionId: 0x278E, VarStoreId: 0x1, VarOffset: 0x135, Flags: 0x10, Size: 8, Min: 0x0, Max: 0x3, Step: 0x0
					OneOfOption Option: "Unknown Device" Value: 0, Default, MfgDefault
					OneOfOption Option: "Unknown Device" Value: 1
					OneOfOption Option: "Unknown Device" Value: 2
					OneOfOption Option: "Unknown Device" Value: 3
				End 
			End 
			SuppressIf 
				EqIdVal QuestionId: 0x372, Value: 0x5
					Not 
				End 
				OneOf Prompt: "Output Select", Help: "Output Interface", QuestionFlags: 0x4, QuestionId: 0x278F, VarStoreId: 0x1, VarOffset: 0x135, Flags: 0x10, Size: 8, Min: 0x0, Max: 0x4, Step: 0x0
					OneOfOption Option: "Unknown Device" Value: 0, Default, MfgDefault
					OneOfOption Option: "Unknown Device" Value: 1
					OneOfOption Option: "Unknown Device" Value: 2
					OneOfOption Option: "Unknown Device" Value: 3
					OneOfOption Option: "Unknown Device" Value: 4
				End 
			End 
			SuppressIf 
				EqIdVal QuestionId: 0x372, Value: 0x6
					Not 
				End 
				OneOf Prompt: "Output Select", Help: "Output Interface", QuestionFlags: 0x4, QuestionId: 0x2790, VarStoreId: 0x1, VarOffset: 0x135, Flags: 0x10, Size: 8, Min: 0x0, Max: 0x5, Step: 0x0
					OneOfOption Option: "Unknown Device" Value: 0, Default, MfgDefault
					OneOfOption Option: "Unknown Device" Value: 1
					OneOfOption Option: "Unknown Device" Value: 2
					OneOfOption Option: "Unknown Device" Value: 3
					OneOfOption Option: "Unknown Device" Value: 4
					OneOfOption Option: "Unknown Device" Value: 5
				End 
			End 
			SuppressIf 
				EqIdVal QuestionId: 0x372, Value: 0x7
					Not 
				End 
				OneOf Prompt: "Output Select", Help: "Output Interface", QuestionFlags: 0x4, QuestionId: 0x2791, VarStoreId: 0x1, VarOffset: 0x135, Flags: 0x10, Size: 8, Min: 0x0, Max: 0x6, Step: 0x0
					OneOfOption Option: "Unknown Device" Value: 0, Default, MfgDefault
					OneOfOption Option: "Unknown Device" Value: 1
					OneOfOption Option: "Unknown Device" Value: 2
					OneOfOption Option: "Unknown Device" Value: 3
					OneOfOption Option: "Unknown Device" Value: 4
					OneOfOption Option: "Unknown Device" Value: 5
					OneOfOption Option: "Unknown Device" Value: 6
				End 
			End 
			SuppressIf 
				EqIdVal QuestionId: 0x372, Value: 0x8
					Not 
				End 
				OneOf Prompt: "Output Select", Help: "Output Interface", QuestionFlags: 0x4, QuestionId: 0x2792, VarStoreId: 0x1, VarOffset: 0x135, Flags: 0x10, Size: 8, Min: 0x0, Max: 0x7, Step: 0x0
					OneOfOption Option: "Unknown Device" Value: 0, Default, MfgDefault
					OneOfOption Option: "Unknown Device" Value: 1
					OneOfOption Option: "Unknown Device" Value: 2
					OneOfOption Option: "Unknown Device" Value: 3
					OneOfOption Option: "Unknown Device" Value: 4
					OneOfOption Option: "Unknown Device" Value: 5
					OneOfOption Option: "Unknown Device" Value: 6
					OneOfOption Option: "Unknown Device" Value: 7
				End 
			End 
		End 
	End 

So I fired up RU.efi and looked for the value of 0x372 in the AmiGopPolicySetupData to see that it has a value of 3 so my EFI recognizes three outputs. So I did change the value for 0x135 in the Setup to 1 and 2 but sadly after rebooting it is always reset..

I guess that unlocking the hidden values will not give me the ability to force the UEFI to a specific output. I do wonder though if there is anything that would allow me to disable the automatic recognition. But I looked around the IFR and searched for primary, gpu, graphic and output which didn’t reveal any other hidden settings apart from the ones I showed above.

So is this controlled by the driver or by the GOP of the GPU?

Sorry if my questions sound dumb but I don’t have much knowledge on how the whole EFI stuff exactly works.

Similar… some info and you may need to contact MSI for some feedback.
And one thing is for sure and “old” general rule… VGA → DVI → HDMI → DP.
X570 Gaming Plus: no image in Bios with dual GPU | MSI Global English Forum

EDIT:

I meant bios initialization not internal dGPU output priority… anyway, who am i to say otherwise.

And one thing is for sure and “old” general rule… VGA → DVI → HDMI → DP.

I don’t think this always holds true, since I have a monitor connected via HDMI and DP to my GTX 1080 and the BIOS shows on the DP monitor.

I also stumbled upon this thread but they had freezing issues. I didn’t think about contacting MSI since manufacturer support is generally bad when it comes to niche issues that don’t involve general hardware faults so I doubt they will help me.

But I might try anyway, at least they have a direct ticket system and still provide updates for this motherboard, so I might have some luck.

Edit: Alright so I just installed an AMD HD5450 (with a modded VBIOS to inject GOP) into my PC to describe the exact behavior. If the card is just installed but NO monitor is connected to the AMD card, I see the short flashing doslike cursor on my primary monitor (DP @ Nvidia card), then afterwards I get no UEFI at all on my monitors connected to the Nvidia card.

If I then connect any monitor to any port on the AMD card it displays the UEFI on the monitor connected to the AMD card. Interestingly, if I then enter the EFI Shell it duplicates the output on both cards with both monitors.

When I install the original VBIOS to the AMD card without GOP I can’t get into the UEFI at all even with CSM enabled. No output on any monitor until it boots to an OS. Yeah and I can’t reflash the GOP bios to the card since I can’t blindly get into DOS and amdvbflash on Windows and Linux refuses to recognize the card.