protonscr

DXVK doesn't work with Intel HD Graphics Windows Vulkan driver..

dxvkclosed wontfixintel anv
doitsujin/dxvk#62 · opened 2018-02-05 by oscarbg · updated 2018-08-07 · 11 comments · github
Ooscarbg 2018-02-05 github

now that DXVK is sane enough to generate both d3d11.dll and dxgi.dll using it on Windows for testing is much easier..
As my previous reports show multiple games work/or at least launch to menu and also ComputeMark..

Nvidia has improved from crashing to working the sample apps included (d3d11-compute & trinagle)
but still some bugs are left as for example ComputeMark2 renders all tests black screen saying failing
err: DxvkComputePipeline: Failed to compile pipeline

Anyway more stange is on Intel iGPUs all basic samples ( dxgi-factory d3d11-triange d3d11-compute) fail
the problem is don't crash.. the executable launched from command line doesn't return.. and worse is that all file logs (like dxgi-factory_dxgi.log) are empty (0bytes) even seeing while executing app or after forced close
of course I have tests Intel Vulkan driver with Windows apps and it works correctly is not a problem of having it installed incorrectly..
also this driver I use 4933 has lots of extensions (https://vulkan.gpuinfo.org/displayreport.php?id=2529#extensions)
so I assume all you need are there..

Software information

all fail dxgi-factory d3d11-triange d3d11-compute

System information

Log files

  • d3d11.log: produced files are empty
  • dxgi.log: produced files are empty
GGabrielMajeri 2018-02-05 github

The information on the Intel driver on the wiki applies to both Linux and Windows.

All Intel drivers currently lack depth bounds and UAVs, and without those features DXVK won't work.

Ooscarbg 2018-02-05 github

Ah OK I saw ANV driver not supported not remembered Windows driver is about the same..

Ddoitsujin maintainer 2018-02-06 github

Can you post vulkaninfo output? My guess is that DXVK is trying to use some features that the driver doesn't support, which is actually the case on ANV driver at the moment.

GGabrielMajeri 2018-02-06 github

I'd recently wanted to find out whether there is a difference between Intel ANV and Intel for Windows.

I uploaded a GPU report for Windows here, and one on ArchLinux here. depthBounds are not supported on either.

Here's a diff of all the features.

diff windows linux 
27c27
< shaderInt16	true
---
> shaderInt16	false
29,30c29,30
< shaderResourceMinLod	true
< shaderResourceResidency	true
---
> shaderResourceMinLod	false
> shaderResourceResidency	false
35c35
< shaderStorageImageMultisample	true
---
> shaderStorageImageMultisample	false
40,48c40,48
< sparseBinding	true
< sparseResidency16Samples	true
< sparseResidency2Samples	true
< sparseResidency4Samples	true
< sparseResidency8Samples	true
< sparseResidencyAliased	true
< sparseResidencyBuffer	true
< sparseResidencyImage2D	true
< sparseResidencyImage3D	true
---
> sparseBinding	false
> sparseResidency16Samples	false
> sparseResidency2Samples	false
> sparseResidency4Samples	false
> sparseResidency8Samples	false
> sparseResidencyAliased	false
> sparseResidencyBuffer	false
> sparseResidencyImage2D	false
> sparseResidencyImage3D	false
53c53
< variableMultisampleRate	true
---
> variableMultisampleRate	false
Ooscarbg 2018-03-02 github

The issue is about calling vkCreateInstance on his driver ends up calling your dxgi CreateDXGIFactory or CreateDXGIFactory1 method which also ends up calling vkCreateInstance:
I solve assuming first call to CreateDXGIFactory* is from app others are from Intel Vulkan driver:
very crude hack:
feel free to improve:
note I have seen in AMD or Nvidia Vulkan driver binaries also DXGI and CreateDXGIFactory references but may be they end up loading correct DXGI from Windows system folder..
may be it's an Intel bug and should be pointed to them..

--- C:\dxvk\igpu2\dxvk\src\dxgi\dxgi_mainori - copia.cpp	2018-03-02 17:37:04.831000000 +0100
+++ C:\dxvk\igpu2\dxvk\src\dxgi\dxgi_main.cpp	2018-03-02 18:04:17.604000000 +0100
@@ -22,12 +22,39 @@
   }
 }
 
+typedef HRESULT (__stdcall PFN_trueCreateDXGIFactory1)(REFIID riid, _COM_Outptr_  void **ppFactory);
+typedef HRESULT(__stdcall PFN_trueCreateDXGIFactory)(REFIID riid, _COM_Outptr_  void **ppFactory);
+
 extern "C" {
+	static int counter1 = 0;
+	
   DLLEXPORT HRESULT __stdcall CreateDXGIFactory1(REFIID riid, void **ppFactory) {
-    return dxvk::createDxgiFactory(riid, ppFactory);
+	  counter1++;
+		if (counter1 > 1)
+		{
+			HMODULE lib = LoadLibrary("c:\\windows\\system32\\dxgi.dll");
+			PFN_trueCreateDXGIFactory1 *fp = (PFN_trueCreateDXGIFactory1*) GetProcAddress(lib, "CreateDXGIFactory1");
+			// cast p to the approriate function pointer type (fp) and call it
+
+			return fp(riid, ppFactory);
+			FreeLibrary(lib);
+		}
+		else
+			return dxvk::createDxgiFactory(riid, ppFactory);
   }
   
   DLLEXPORT HRESULT __stdcall CreateDXGIFactory(REFIID riid, void **ppFactory) {
+	  counter1++;
+		if (counter1 > 1)
+		{
+			HMODULE lib = LoadLibrary("c:\\windows\\system32\\dxgi.dll");
+			PFN_trueCreateDXGIFactory *fp = (PFN_trueCreateDXGIFactory*)GetProcAddress(lib, "CreateDXGIFactory");
+			// cast p to the approriate function pointer type (fp) and call it
+
+			return fp(riid, ppFactory);
+			FreeLibrary(lib);
+		}
+		else
     return dxvk::createDxgiFactory(riid, ppFactory);
   }
 }
\ No newline at end of file
Ddoitsujin maintainer 2018-05-12 github

I'll close this as I have no intention to support a workaround only for Intel's Windows driver.

Kkaydenl 2018-05-26 github

To clarify...Intel GPU hardware doesn't support depth bounds test. Drivers would have to emulate the feature with software, and none of them - on any OS - do that today. So, this resolution basically means "DXVK won't work on Intel GPUs".

It seems a bit odd to require a feature that's optional even in DX12...

Ddoitsujin maintainer 2018-05-26 github

@kaydenl The depth bounds requirement was a mistake that I fixed several months ago, and DXVK works on ANV (sort of). It doesn't work on the Windows driver because it tries to create a DXGI factory, but it does so with DXVK's dxgi.dll and not the one provided by Microsoft, which results in an infinite recursion.

Kkaydenl 2018-05-26 github

Oh, nevermind then. Thanks! Someone was confused and asking us to support that feature for DXVK. Sounds like we don't need to.

Rryao 2018-05-27 github

@doitsujin That someone was me. @kaydenl Thanks for taking the time to comment on this. I appreciate it. :)

Ooscarbg 2018-08-07 github

I have pinged @SlawomirCn of Intel Win Vulkan team on twitter.. let'see if it can help..
also seems is @scygan user of github?
also seems slawomir.grajewski 'at' intel.com is another dev who can possibly help..
mailing later if no response..

DLLs