kvm-guest-drivers-windows: viogpudo /virtio-vga broken in recent Windows builds

In recent Windows versions, like Windows 11 IoT 24H2, when using the virtio-vga graphics device, the screen turns black when installing the viogpudo driver and stays black until the next reboot.

Using the std VGA device everything works.

The problem even exists with the new beta drivers, version 0.1.258.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 56 (17 by maintainers)

Most upvoted comments

I’ve tried debugging this issue some more. Following https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-debug-apps?view=windows-11 I was able to create a WinPE boot ISO with debugging and test signing enabled. This allows me to attach windbg in WinPE. Using drvload allows me to load a test build of the driver.

This is the log output when loading the driver in WinPE:

---> KMDOD build on on Oct  9 2023 00:17:09
<--- DriverEntry
---> VioGpuDodAddDevice
---> VioGpuDod::VioGpuDod
<--- VioGpuDod::VioGpuDod
<--- VioGpuDodAddDevice ppDeviceContext = FFFFCD8361088CB0
<---> VioGpuDodQueryInterface
<---> VioGpuDod::QueryInterface Version = 1
<---> VioGpuDodQueryInterface
<---> VioGpuDod::QueryInterface Version = 1
<---> VioGpuDodStartDevice
---> VioGpuDod::CheckHardware
<--- VioGpuDod::CheckHardware VendorId = 0x1AF4 DeviceId = 0x1050
Creating list FFFFCD8360E30E38 FFFFCD8360E30E38
---> VioGpuBuf::VioGpuBuf
<--- VioGpuBuf::VioGpuBuf
---> VioGpuMemSegment::VioGpuMemSegment
<--- VioGpuMemSegment::VioGpuMemSegment
---> VioGpuMemSegment::VioGpuMemSegment
<--- VioGpuMemSegment::VioGpuMemSegment
---> VioGpuMemSegment::VioGpuMemSegment
<--- VioGpuMemSegment::VioGpuMemSegment
---> VioGpuAdapter::HWInit
---> CPciResources::Init
<--> CPciResources::Init BytesRead = 64
---> CPciResources::Init ListCount = 1
Found IO memory at 10000000(8388608) bar 0
Unsupported descriptor type = 129
Found IO memory at 10866000(4096) bar 1
Unsupported descriptor type = 129
Found IO memory at 8000004000(16384) bar 4
Unsupported descriptor type = 129
Found Interrupt vector 2828, level 11, affinity 0x3FF, flags 0
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
[CPciBar::GetVA] mapped memory BAR at 8000004000
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> PCIReadConfig
---> VioGpuMemSegment::Init
<--- VioGpuMemSegment::Init
---> VioGpuMemSegment::Init
<--- VioGpuMemSegment::Init
---> VioGpuQueue::QueryAllocation
<--- VioGpuQueue::QueryAllocation
---> VioGpuQueue::QueryAllocation
<--- VioGpuQueue::QueryAllocation
VioGpuAdapter::HWInit size 80
---> VioGpuBuf::Init
<--- VioGpuBuf::Init
VioGpuAdapter::HWInit num_scanouts 1, num_capsets 0
---> VioGpuAdapter::GetModeList
m_ModeInfo = 0xFFFFA404A38D9260, m_ModeNumbers = 0xFFFFA404A39C4950
VioGpuAdapter::GetModeList: Height = 0 Width = 0 BitsPerPixel = 0
<--- VioGpuAdapter::GetModeList ColorFormat = 0
VioGpuAdapter::GetModeList: modes[0] x_res = 1024, y_res = 640, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[1] x_res = 1024, y_res = 665, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[2] x_res = 1024, y_res = 768, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[3] x_res = 1147, y_res = 745, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[4] x_res = 1152, y_res = 720, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[5] x_res = 1168, y_res = 755, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[6] x_res = 1280, y_res = 800, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[7] x_res = 1280, y_res = 1024, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[8] x_res = 1312, y_res = 848, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[9] x_res = 1344, y_res = 840, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[10] x_res = 1352, y_res = 878, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[11] x_res = 1440, y_res = 900, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[12] x_res = 1496, y_res = 967, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[13] x_res = 1512, y_res = 982, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[14] x_res = 1680, y_res = 1050, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[15] x_res = 1728, y_res = 1117, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[16] x_res = 1792, y_res = 1120, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[17] x_res = 1800, y_res = 1169, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[18] x_res = 1920, y_res = 1080, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[19] x_res = 1920, y_res = 1200, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[20] x_res = 2048, y_res = 1280, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[21] x_res = 2056, y_res = 1329, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[22] x_res = 2240, y_res = 1260, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[23] x_res = 2560, y_res = 1440, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[24] x_res = 2560, y_res = 1600, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[25] x_res = 2880, y_res = 1800, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[26] x_res = 3024, y_res = 1964, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[27] x_res = 3072, y_res = 1920, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[28] x_res = 3456, y_res = 2234, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[29] x_res = 4480, y_res = 2520, bits = 32 BitsPerPixel = 32
VioGpuAdapter::GetModeList: modes[30] x_res = 5120, y_res = 2880, bits = 32 BitsPerPixel = 32
ModeCount filtered 28
type 0, XRes = 1024, YRes = 768, BPP = 32
type 1, XRes = 1280, YRes = 800, BPP = 32
type 2, XRes = 1280, YRes = 1024, BPP = 32
type 3, XRes = 1312, YRes = 848, BPP = 32
type 4, XRes = 1344, YRes = 840, BPP = 32
type 5, XRes = 1352, YRes = 878, BPP = 32
type 6, XRes = 1440, YRes = 900, BPP = 32
type 7, XRes = 1496, YRes = 967, BPP = 32
type 8, XRes = 1512, YRes = 982, BPP = 32
type 9, XRes = 1680, YRes = 1050, BPP = 32
type a, XRes = 1728, YRes = 1117, BPP = 32
type b, XRes = 1792, YRes = 1120, BPP = 32
type c, XRes = 1800, YRes = 1169, BPP = 32
type d, XRes = 1920, YRes = 1080, BPP = 32
type e, XRes = 1920, YRes = 1200, BPP = 32
type f, XRes = 2048, YRes = 1280, BPP = 32
type 10, XRes = 2056, YRes = 1329, BPP = 32
type 11, XRes = 2240, YRes = 1260, BPP = 32
type 12, XRes = 2560, YRes = 1440, BPP = 32
type 13, XRes = 2560, YRes = 1600, BPP = 32
type 14, XRes = 2880, YRes = 1800, BPP = 32
type 15, XRes = 3024, YRes = 1964, BPP = 32
type 16, XRes = 3072, YRes = 1920, BPP = 32
type 17, XRes = 3456, YRes = 2234, BPP = 32
type 18, XRes = 4480, YRes = 2520, BPP = 32
type 19, XRes = 5120, YRes = 2880, BPP = 32
type 1a, XRes = 1024, YRes = 768, BPP = 32
type 1b, XRes = 1024, YRes = 768, BPP = 32
---> VioGpuAdapter::GetDisplayInfo
---> CtrlQueue::AskDisplayInfo
---> CtrlQueue::AllocCmdResp
---> VioGpuBuf::GetBuf
<--- VioGpuBuf::GetBuf buf = FFFFCD8361212090
<--- CtrlQueue::AllocCmdResp
---> CtrlQueue::QueueBuffer
<--> CtrlQueue::QueueBuffer sgleft 30
---> VioGpuQueue::Lock at IRQL 0
<--- VioGpuQueue::Lock
---> VioGpuQueue::Unlock at IRQL 0
<--- VioGpuQueue::Unlock
<---> VioGpuDodInterruptRoutine
<--> VioGpuDod::InterruptRoutine
---> VioGpuAdapter::InterruptRoutine MessageNumber = 0
<--- VioGpuAdapter::InterruptRoutine Interrupt Reason = 1
---> VioGpuDodDpcRoutine
---> VioGpuDod::DpcRoutine
---> VioGpuAdapter::DpcRoutine
<--- CtrlQueue::QueueBuffer ret = 62
---> CtrlQueue::DequeueBuffer
---> VioGpuQueue::Lock at IRQL 2
<--- VioGpuQueue::Lock
---> VioGpuQueue::Unlock at IRQL 2
<--- VioGpuQueue::Unlock
<--- CtrlQueue::DequeueBuffer
---> VioGpuAdapter::DpcRoutine m_CtrlQueue pvbuf = FFFFCD8361212090 len = 408
---> CtrlQueue::DequeueBuffer
<--- CtrlQueue::AskDisplayInfo
---> VioGpuQueue::Lock at IRQL 2
---> CtrlQueue::GetDisplayInfo
<--- VioGpuQueue::Lock
output 0: 1280x800+0+0
---> VioGpuQueue::Unlock at IRQL 2
<--- VioGpuQueue::Unlock
<--- CtrlQueue::GetDisplayInfo
<--- CtrlQueue::DequeueBuffer
---> VioGpuAdapter::GetDisplayInfo (1280x800)
---> CrsrQueue::DequeueCursor
VioGpuAdapter::SetCustomDisplay - 0 (1280x800#32)
VioGpuAdapter::SetCustomDisplay - 27 (1280x800)
---> VioGpuQueue::Lock at IRQL 2
<--- VioGpuQueue::Lock
---> VioGpuQueue::Unlock at IRQL 2
<--- VioGpuQueue::Unlock
<--- CrsrQueue::DequeueCursor buf 0000000000000000 len = 317687620
<--- VioGpuAdapter::DpcRoutine
<--- VioGpuDod::DpcRoutine
---> VioGpuQueue::ReleaseBuffer
---> VioGpuBuf::FreeBuf buf = FFFFCD8361212090
<--- VioGpuDodDpcRoutine
<--- VioGpuBuf::FreeBuf
<--- VioGpuQueue::ReleaseBuffer
<--- VioGpuAdapter::GetDisplayInfo
<--- VioGpuAdapter::GetModeList
---> VioGpuDod::RegisterHWInfo
---> VioGpuDod::WriteHWInfoStr
<--- VioGpuDod::WriteHWInfoStr
---> VioGpuDod::WriteHWInfoStr
<--- VioGpuDod::WriteHWInfoStr
---> VioGpuDod::WriteHWInfoStr
<--- VioGpuDod::WriteHWInfoStr
---> VioGpuDod::WriteHWInfoStr
<--- VioGpuDod::WriteHWInfoStr
<--- VioGpuDod::RegisterHWInfo
<--- VioGpuDod::StartDevice ColorFormat = 21
<--- VioGpuDod::StartDevice
<---> VioGpuDodQueryChildRelations
---> VioGpuDod::QueryChildRelations
<--- VioGpuDod::QueryChildRelations
<---> VioGpuDodQueryAdapterInfo
---> VioGpuDod::QueryAdapterInfo
InterruptMessageNumber = 0, WDDMVersion = 0
<--- VioGpuDod::QueryAdapterInfo 1
<---> VioGpuDodQueryAdapterInfo
---> VioGpuDod::QueryAdapterInfo
<--- VioGpuDod::QueryAdapterInfo
<---> VioGpuDodQueryInterface
<---> VioGpuDod::QueryInterface Version = 1
<---> VioGpuDodQueryDeviceDescriptor
---> VioGpuDod::QueryDeviceDescriptor
<--- VioGpuDod::QueryDeviceDescriptor
<---> VioGpuDodQueryDeviceDescriptor
---> VioGpuDod::QueryDeviceDescriptor
<--- VioGpuDod::QueryDeviceDescriptor
<---> VioGpuDodRecommendMonitorModes
---> VioGpuDod::RecommendMonitorModes
---> VioGpuDod::AddSingleMonitorMode
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1024x768, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1280x800, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1280x1024, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1312x848, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1344x840, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1352x878, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1440x900, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1496x967, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1512x982, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1680x1050, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1728x1117, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1792x1120, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1800x1169, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1920x1080, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1920x1200, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 2048x1280, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 2056x1329, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 2240x1260, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 2560x1440, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 2560x1600, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 2880x1800, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 3024x1964, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 3072x1920, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 3456x2234, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 4480x2520, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 5120x2880, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1024x768, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
VioGpuDod::AddSingleMonitorMode: add pref mode, dimensions 1280x800, taken from DxgkCbAcquirePostDisplayOwnership at StartDevice
<--- VioGpuDod::AddSingleMonitorMode
<---> VioGpuDodQueryInterface
<---> VioGpuDod::QueryInterface Version = 1
<---> VioGpuDodQueryInterface
<---> VioGpuDod::QueryInterface Version = 2
<---> VioGpuDodQueryInterface
<---> VioGpuDod::QueryInterface Version = 1
<---> VioGpuDodQueryInterface
<---> VioGpuDod::QueryInterface Version = 1
<---> VioGpuDodQueryInterface
<---> VioGpuDod::QueryInterface Version = 1
<---> VioGpuDodQueryInterface
<---> VioGpuDod::QueryInterface Version = 1
<---> VioGpuDodQueryInterface
<---> VioGpuDod::QueryInterface Version = 1
<---> VioGpuDodQueryInterface
<---> VioGpuDod::QueryInterface Version = 2

The log stops there. In a normal working windows install, a bunch of log entries continue. The next lines should be something like:

<---> VioGpuDodIsSupportedVidPn
---> VioGpuDod::IsSupportedVidPn
<--- VioGpuDod::IsSupportedVidPn
<---> VioGpuDodIsSupportedVidPn
---> VioGpuDod::IsSupportedVidPn
<--- VioGpuDod::IsSupportedVidPn
<---> VioGpuDodIsSupportedVidPn
---> VioGpuDod::IsSupportedVidPn
<--- VioGpuDod::IsSupportedVidPn
<---> VioGpuDodEnumVidPnCofuncModality
---> VioGpuDod::EnumVidPnCofuncModality
---> VioGpuDod::AddSingleSourceMode
<--- VioGpuDod::AddSingleSourceMode
---> VioGpuDod::AddSingleTargetMode
<--- VioGpuDod::AddSingleTargetMode
<--- VioGpuDod::EnumVidPnCofuncModality
<---> VioGpuDodIsSupportedVidPn
---> VioGpuDod::IsSupportedVidPn
<--- VioGpuDod::IsSupportedVidPn
<---> VioGpuDodEnumVidPnCofuncModality
---> VioGpuDod::EnumVidPnCofuncModality
---> VioGpuDod::AddSingleTargetMode
<--- VioGpuDod::AddSingleTargetMode
<--- VioGpuDod::EnumVidPnCofuncModality
<---> VioGpuDodIsSupportedVidPn
---> VioGpuDod::IsSupportedVidPn
<--- VioGpuDod::IsSupportedVidPn
<---> VioGpuDodEnumVidPnCofuncModality
---> VioGpuDod::EnumVidPnCofuncModality
<--- VioGpuDod::EnumVidPnCofuncModality
<---> VioGpuDodIsSupportedVidPn
---> VioGpuDod::IsSupportedVidPn
<--- VioGpuDod::IsSupportedVidPn
<---> VioGpuDodEnumVidPnCofuncModality
---> VioGpuDod::EnumVidPnCofuncModality
<--- VioGpuDod::EnumVidPnCofuncModality
<---> VioGpuDodIsSupportedVidPn
---> VioGpuDod::IsSupportedVidPn
<--- VioGpuDod::IsSupportedVidPn
<---> VioGpuDodEnumVidPnCofuncModality
---> VioGpuDod::EnumVidPnCofuncModality
<--- VioGpuDod::EnumVidPnCofuncModality
<---> VioGpuDodIsSupportedVidPn
---> VioGpuDod::IsSupportedVidPn
...

This says to me that Windows isn’t deciding to enumerate modes as per https://learn.microsoft.com/en-us/windows-hardware/drivers/display/enumerating-cofunctional-vidpn-source-and-target-modes

The docs say “from time to time” Windows will enumerate modes but doesn’t specify the exact conditions. From testing it seems like in normal boot and upon driver install, it will happen after the new display miniport driver gets loaded. However, in WinPE, that doesn’t happen. It would be nice if anyone with direct contact with Microsoft can ask them about this and if the driver has to do anything extra to get dxgkrnl to call IsSupportedVidPn

I don’t know if this is related but there was another issue that has been bothering me for a long time (as in years) which is that the viogpudo driver doesn’t inhibit the Microsoft Basic Display on arm64. On x86_64 builds, when viogpudo gets loaded, Microsoft Basic Display gets disabled and only one display shows up in settings. However, on arm64, when viogpudo gets loaded, there are two displays because the boot display (Microsoft Basic Display attached to the UEFI initialized framebuffer) isn’t disabled. I’ve tried all sorts of ways to try to get Windows to hide Microsoft Basic Display but in the end I used a registry hack to manually disable it.

What’s the point of this story? I think it might be related because it’s possible that this strange behaviour that I only observed on arm64 is now showing up on x86_64 as well because if you try to render to the boot display, you will get a black screen. I’m not a windows debugging expert, but can someone check if it goes to a black screen how many display devices does windows think is there and which one it thinks is the primary video device?

Issue still present in v0.1.266

@kroese

Dehan shared with me all the scripts that he uses. I’m trying to reproduce and investigate this issue.

Hi @kroese, I could reproduce this issue on

  1. win2025/Win11 24H2/win2022 with the latest 262prewhql.iso.
  2. win2025/Win11 24H2 with the 258prewhql.iso

scenario:

  • After loading virtio-GPU driver. the screen gotta black situation and couldn’t login system.