Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
oscarbg opened this issue Feb 5, 2018 · 11 comments
Closed

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

oscarbg opened this issue Feb 5, 2018 · 11 comments

Comments

@oscarbg
Copy link

oscarbg commented Feb 5, 2018

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

  • GPU: Intel HD 530
  • Driver: Intel graphics driver 23.20.16.4933
  • Wine version: none run native
  • DXVK version: latest up to 26ef59d

Log files

  • d3d11.log: produced files are empty
  • dxgi.log: produced files are empty
@GabrielMajeri
Copy link
Contributor

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.

@oscarbg
Copy link
Author

oscarbg commented Feb 5, 2018

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

@doitsujin
Copy link
Owner

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.

@GabrielMajeri
Copy link
Contributor

GabrielMajeri commented Feb 6, 2018

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

@oscarbg
Copy link
Author

oscarbg commented Mar 2, 2018

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

@doitsujin
Copy link
Owner

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

@kaydenl
Copy link

kaydenl commented May 26, 2018

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...

@doitsujin
Copy link
Owner

doitsujin commented May 26, 2018

@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.

@kaydenl
Copy link

kaydenl commented May 26, 2018

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

@ryao
Copy link
Contributor

ryao commented May 27, 2018

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

@oscarbg
Copy link
Author

oscarbg commented Aug 7, 2018

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..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants