Index: /trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h	(revision 71510)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h	(revision 71511)
@@ -33,4 +33,19 @@
 extern DWORD g_VBoxDisplayOnly;
 # include "wddm/VBoxMPTypes.h"
+#endif
+
+typedef enum VBOX_HWTYPE
+{
+    VBOX_HWTYPE_CROGL = 0,
+    VBOX_HWTYPE_VMSVGA = 1
+} VBOX_HWTYPE;
+
+#ifdef VBOX_WDDM_MINIPORT
+typedef struct VBOXWDDM_HWRESOURCES
+{
+    PHYSICAL_ADDRESS phVRAM;
+    ULONG cbVRAM;
+    ULONG ulApertureSize;
+} VBOXWDDM_HWRESOURCES, *PVBOXWDDM_HWRESOURCES;
 #endif
 
@@ -202,4 +217,10 @@
 
    HGSMIAREA areaDisplay;                      /* Entire VRAM chunk for this display device. */
+
+   VBOX_HWTYPE enmHwType;
+#ifdef VBOX_WDDM_MINIPORT
+   VBOXWDDM_HWRESOURCES HwResources;
+#endif
+
 } VBOXMP_DEVEXT, *PVBOXMP_DEVEXT;
 
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp	(revision 71510)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp	(revision 71511)
@@ -725,11 +725,4 @@
     return VBOXWDDM_HGSMICMD_TYPE_UNDEFINED;
 }
-
-typedef struct VBOXWDDM_HWRESOURCES
-{
-    PHYSICAL_ADDRESS phVRAM;
-    ULONG cbVRAM;
-    ULONG ulApertureSize;
-} VBOXWDDM_HWRESOURCES, *PVBOXWDDM_HWRESOURCES;
 
 NTSTATUS vboxWddmPickResources(PVBOXMP_DEVEXT pDevExt, PDXGK_DEVICE_INFO pDeviceInfo, PVBOXWDDM_HWRESOURCES pHwResources)
@@ -820,4 +813,11 @@
 
     VBoxVidPnTargetsInit(pDevExt->aTargets, RT_ELEMENTS(pDevExt->aTargets), 0);
+
+    uint32_t u32 = 0;
+    if (VBoxVGACfgAvailable())
+    {
+        VBoxVGACfgQuery(VBE_DISPI_CFG_ID_VMSVGA, &u32, 0);
+    }
+    pDevExt->enmHwType = u32 ? VBOX_HWTYPE_VMSVGA : VBOX_HWTYPE_CROGL;
 }
 
@@ -1139,6 +1139,5 @@
         if (Status == STATUS_SUCCESS)
         {
-            VBOXWDDM_HWRESOURCES HwRc;
-            Status = vboxWddmPickResources(pDevExt, &DeviceInfo, &HwRc);
+            Status = vboxWddmPickResources(pDevExt, &DeviceInfo, &pDevExt->HwResources);
             if (Status == STATUS_SUCCESS)
             {
@@ -1169,5 +1168,5 @@
                  */
                 VBoxSetupDisplaysHGSMI(VBoxCommonFromDeviceExt(pDevExt),
-                                       HwRc.phVRAM, HwRc.ulApertureSize, HwRc.cbVRAM,
+                                       pDevExt->HwResources.phVRAM, pDevExt->HwResources.ulApertureSize, pDevExt->HwResources.cbVRAM,
                                        VBVACAPS_COMPLETEGCMD_BY_IOREAD | VBVACAPS_IRQ);
                 if (VBoxCommonFromDeviceExt(pDevExt)->bHGSMI)
@@ -7595,4 +7594,5 @@
     if (RT_SUCCESS(rc))
     {
+        /* Check whether 3D is required by the guest. */
         if (major > 6)
         {
@@ -7620,40 +7620,84 @@
         LOG(("3D is %srequired!", f3DRequired? "": "NOT "));
 
-        Status = STATUS_SUCCESS;
+        /* Check whether 3D is provided by the host. */
+        VBOX_HWTYPE enmHwType = VBOX_HWTYPE_CROGL;
+        BOOL f3DSupported = FALSE;
+
+        if (VBoxVGACfgAvailable())
+        {
+            /* New configuration query interface is available. */
+            uint32_t u32;
+            if (VBoxVGACfgQuery(VBE_DISPI_CFG_ID_VERSION, &u32, 0))
+            {
+                LOGREL(("VGA configuration version %d", u32));
+            }
+
+            VBoxVGACfgQuery(VBE_DISPI_CFG_ID_3D, &u32, 0);
+            f3DSupported = RT_BOOL(u32);
+
+            VBoxVGACfgQuery(VBE_DISPI_CFG_ID_VMSVGA, &u32, 0);
+            if (u32)
+            {
+                enmHwType = VBOX_HWTYPE_VMSVGA;
+            }
+        }
+
+        BOOL fCmdVbva = FALSE;
+        if (enmHwType == VBOX_HWTYPE_CROGL)
+        {
+            /* Try to establish connection to the host 3D service. */
 #ifdef VBOX_WITH_CROGL
-        VBoxMpCrCtlConInit();
-
-        /* always need to do the check to request host caps */
-        LOG(("Doing the 3D check.."));
-        if (!VBoxMpCrCtlConIs3DSupported())
-#endif
-        {
-            /* No 3D support by the host. */
-            if (VBoxQueryWinVersion() >= WINVERSION_8)
-            {
-                /* Use display only driver for Win8+. */
-                g_VBoxDisplayOnly = 1;
-
-                /* Black list some builds. */
-                if (major == 6 && minor == 4 && build == 9841)
-                {
-                    /* W10 Technical preview crashes with display-only driver. */
-                    LOGREL(("3D is NOT supported by the host, fallback to the system video driver."));
-                    Status = STATUS_UNSUCCESSFUL;
+            VBoxMpCrCtlConInit();
+
+            /* always need to do the check to request host caps */
+            LOG(("Doing the 3D check.."));
+            f3DSupported = VBoxMpCrCtlConIs3DSupported();
+
+            fCmdVbva = RT_BOOL(VBoxMpCrGetHostCaps() & CR_VBOX_CAP_CMDVBVA);
+#endif
+        }
+        else if (enmHwType == VBOX_HWTYPE_VMSVGA)
+        {
+            fCmdVbva = TRUE;
+        }
+        else
+        {
+            Status = STATUS_UNSUCCESSFUL;
+        }
+
+        LOGREL(("WDDM: 3D is %ssupported, hardware type %d", f3DSupported? "": "not ", enmHwType));
+
+        if (NT_SUCCESS(Status))
+        {
+            if (!f3DSupported)
+            {
+                /* No 3D support by the host. */
+                if (VBoxQueryWinVersion() >= WINVERSION_8)
+                {
+                    /* Use display only driver for Win8+. */
+                    g_VBoxDisplayOnly = 1;
+
+                    /* Black list some builds. */
+                    if (major == 6 && minor == 4 && build == 9841)
+                    {
+                        /* W10 Technical preview crashes with display-only driver. */
+                        LOGREL(("3D is NOT supported by the host, fallback to the system video driver."));
+                        Status = STATUS_UNSUCCESSFUL;
+                    }
+                    else
+                    {
+                        LOGREL(("3D is NOT supported by the host, falling back to display-only mode.."));
+                    }
                 }
                 else
                 {
-                    LOGREL(("3D is NOT supported by the host, falling back to display-only mode.."));
-                }
-            }
-            else
-            {
-                if (f3DRequired)
-                {
-                    LOGREL(("3D is NOT supported by the host, but is required for the current guest version using this driver.."));
-                    Status = STATUS_UNSUCCESSFUL;
-                }
-                else
-                    LOGREL(("3D is NOT supported by the host, but is NOT required for the current guest version using this driver, continuing with Disabled 3D.."));
+                    if (f3DRequired)
+                    {
+                        LOGREL(("3D is NOT supported by the host, but is required for the current guest version using this driver.."));
+                        Status = STATUS_UNSUCCESSFUL;
+                    }
+                    else
+                        LOGREL(("3D is NOT supported by the host, but is NOT required for the current guest version using this driver, continuing with Disabled 3D.."));
+                }
             }
         }
@@ -7672,15 +7716,18 @@
                 else
                 {
-                    Status = vboxWddmInitFullGraphicsDriver(DriverObject, RegistryPath,
-#ifdef VBOX_WITH_CROGL
-                            !!(VBoxMpCrGetHostCaps() & CR_VBOX_CAP_CMDVBVA)
-#else
-                            FALSE
-#endif
-                            );
+                    Status = vboxWddmInitFullGraphicsDriver(DriverObject, RegistryPath, fCmdVbva);
                 }
 
                 if (NT_SUCCESS(Status))
+                {
+                    /*
+                     * Successfully initialized the driver.
+                     */
                     return Status;
+                }
+
+                /*
+                 * Cleanup on failure.
+                 */
 
 #ifdef VBOX_WITH_CROGL
