Merge pull request #1126 from levzzz5154/fix/nvapi-dxgi-recursion

Fix dxvk-nvapi recursion in IdentifyGpu::queryNvapi (fixes #1101)
This commit is contained in:
Michał Lewandowski authored and GitHub committed 2026-09-01 23:07:25 +02:00
commit c983a50033
1 file changed
+6
+6
View File
@@ -194,6 +194,12 @@ std::vector<GpuInformation> IdentifyGpu::checkGpuInfo()
void IdentifyGpu::queryNvapi(GpuInformation& gpuInfo)
{
// Prevent recursion: NvAPI_Initialize (dxvk-nvapi) internally creates a DXGI factory
// and enumerates adapters, which re-enters our hooked EnumAdapters/EnumAdapters1 and
// calls getAllGpus() again while is_fetching is already set (returns empty list).
// Skip the DXGI load checks so nvapi sees the real adapters, allowing init to succeed.
ScopedSkipDxgiLoadChecks skipDxgiLoadChecks {};
auto nvapiModule = NtdllProxy::LoadLibraryExW_Ldr(L"nvapi64.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
// No nvapi, should not be nvidia, possibly external spoofing