Skip to content

Under Proton the driver id query of #225 is not implemented, so an RX 9070 XT would be treated as "not RDNA 4" #248

Closed

Description

@j0nsh1n

#225 decides RDNA 4 only from D3DKMTQueryAdapterInfo with KMTQAITYPE_PHYSICALADAPTERDEVICEIDS (31), and fails closed when that is unavailable (rdna4_win.h driver_device_ids; rdna4.h:81 rdna4_identity needs kmt_known). I checked that query under Proton and Wine on Linux with a small console probe (mingw; it opens each DXGI adapter by its LUID, and also the LUID from ID3D12Device::GetAdapterLuid on vkd3d-proton, then asks for type 31):

Wine Adapter D3DKMTOpenAdapterFromLuid D3DKMTQueryAdapterInfo type 31
GE-Proton 11-11 (proton run, fresh prefix, normal desktop session) AMD Radeon RX 7900 XT (RADV NAVI31), 1002:744C 0x0 0xC0000002 (STATUS_NOT_IMPLEMENTED), ids 0
GE-Proton 11-11 the CPU's integrated Radeon, 1002:13C0 0x0 0xC0000002
Wine 11.21 Staging, headless prefix Wine's placeholder adapter 0x0 0xC0000002

The DXGI LUID and the D3D12 device LUID are the same, so the open works; only the type 31 query is missing in Wine's win32u. As I read bf0654e there is no Wine fallback in rdna4.h, rdna4_win.h, executor_select.h or device_d3d12.cpp, so under Proton an RX 9070 XT would get the front end's upscaler instead of WrongGPU's runtime once a release has #225 (it is not in #48 yet).

Caveat: this machine has an RX 7900 XT at the moment, so I could not run an RX 9070 XT in a game with #225; the query's answer does not depend on the card, but the end-to-end effect in a game is inferred from the code.

Possible directions, your call: a Wine-only fallback (for example DXGI's vendor and device ids, only when the kernel query returns STATUS_NOT_IMPLEMENTED and the process runs under Wine), a developer override, or accepting that Proton players stay on the front end until Wine implements the query (that would also be a Wine bug report: NtGdiDdDDIQueryAdapterInfo type 31).

Probe source on request.

Activity

  1. added this to the 0.6.5 milestone on Nov 15, 2026
  2. phantoslayer21 commented on Nov 15, 2026

    @phantoslayer21
    Owner

    Thanks, this is a clear report. A Proton player on an RX 9070 XT losing WrongGPU because of #225 would be a 0.6.5 regression, so this goes into 0.6.5.

    Plan: a fallback only for Wine. When the kernel query returns STATUS_NOT_IMPLEMENTED and the process runs under Wine, use the DXGI vendor and device ids of the adapter whose LUID matches the D3D12 device, against the same RDNA 4 list. Any spoofed or non-AMD id still fails closed. No change on Windows. I'll post here when the PR is up, and a test from your side would be welcome. The probe source would help too, as a check in the Wine runner.

  3. phantoslayer21 commented on Nov 16, 2026

    @phantoslayer21
    Owner

    Fixed in #252 (merged as 91436c4), thanks for the probe results.

    The fallback applies only when the driver's id query (D3DKMTQueryAdapterInfo type 31) returns STATUS_NOT_IMPLEMENTED and the process runs under Wine. It then uses the system DXGI's vendor and device id of the adapter whose LUID matches the game device's, checked against the same AMD vendor id and RDNA 4 id list. Anything else still fails closed, and on Windows the driver's ids alone decide. When the fallback accepts an adapter, the log gets one line starting with "Wine: the driver's adapter id query is not implemented".

    A result from your Wine runner would be welcome: the RX 7900 XT should get the refusal line with its ids, and an RDNA 4 board the Wine line and the D3D12 executor.

  4. j0nsh1n commented on Nov 16, 2026

    @j0nsh1n
    ContributorAuthor

    Checked #252 (91436c4) under GE-Proton 11-11 on this machine's RX 7900 XT, with a small console probe that runs the runtime's own identity code (rdna4.h and rdna4_win.h at 91436c4) on the LUID of a D3D12 device created on each adapter (vkd3d-proton), and prints the line executor_select.h:86 / :126 would log:

    running_under_wine=1
    adapter 0: AMD Radeon RX 7900 XT (RADV NAVI31) 1002:744c
      driver query status=0xc0000002 kmt_known=0 wine_fallback=1 rdna4=0
      refused: WrongGPU's models need an RX 9000-series GPU; using AMD FSR (adapter AMD Radeon RX 7900 XT (RADV NAVI31), PCI 1002:744C (Wine: the system DXGI's ids); an AMD board outside the RDNA 4 id list)
    adapter 1: AMD Ryzen 7 9700X 8-Core Processor (RADV RAPHAEL_MENDOCINO) 1002:13c0
      driver query status=0xc0000002 kmt_known=0 wine_fallback=1 rdna4=0
      refused: WrongGPU's models need an RX 9000-series GPU; using AMD FSR (adapter AMD Ryzen 7 9700X 8-Core Processor (RADV RAPHAEL_MENDOCINO), PCI 1002:13C0 (Wine: the system DXGI's ids); an AMD board outside the RDNA 4 id list)
    

    So the RX 7900 XT gets the refusal line with its ids, as intended. The RDNA 4 half (the Wine line and the D3D12 executor) I can't run right now: the RX 9070 XT is out of this machine. Headless Wine 11.21 Staging gives the same path for its placeholder adapter.

    Probe source (MIT, mingw: x86_64-w64-mingw32-clang++ -std=c++17 -O1 -static -I clean/runtime -o kmt2.exe kmt2.cpp -ldxgi -ld3d12; it writes kmt2-out.txt next to the exe because Proton does not pass a console program's output through):

    kmt2.cpp
    // SPDX-License-Identifier: MIT
    // Wine check of WrongGPU's adapter identity (#248 / #252): for each adapter, create a D3D12 device and run the runtime's own
    // identity code (clean/runtime/rdna4.h, rdna4_win.h at 91436c4) on the device's LUID. Prints what the interop backend would
    // log: the refusal line (interop/executor_select.h:86) or the Wine fallback line (executor_select.h:126). Writes kmt2-out.txt
    // next to the exe, because Proton does not pass a console program's output through.
    #include <windows.h>
    #include <dxgi1_4.h>
    #include <d3d12.h>
    #include <cstdio>
    #include <string>
    #include "rdna4_win.h"
    static FILE* out;
    int main() {
      wchar_t path[MAX_PATH]; GetModuleFileNameW(nullptr, path, MAX_PATH);
      wchar_t* slash = wcsrchr(path, L'\\'); if (slash) wcscpy(slash + 1, L"kmt2-out.txt");
      out = _wfopen(path, L"w"); if (!out) return 2;
      fprintf(out, "running_under_wine=%d\n", (int)wgrt::running_under_wine());
      IDXGIFactory1* f = nullptr;
      if (FAILED(CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void**)&f))) { fprintf(out, "no dxgi factory\n"); return 1; }
      IDXGIAdapter1* a;
      for (UINT i = 0; f->EnumAdapters1(i, &a) == S_OK; ++i) {
        DXGI_ADAPTER_DESC1 d; a->GetDesc1(&d);
        fprintf(out, "adapter %u: %ls %04x:%04x\n", i, d.Description, d.VendorId, d.DeviceId);
        ID3D12Device* dev = nullptr;
        if (FAILED(D3D12CreateDevice(a, D3D_FEATURE_LEVEL_12_0, __uuidof(ID3D12Device), (void**)&dev))) { fprintf(out, "  no D3D12 device\n"); a->Release(); continue; }
        wgrt::AdapterIdentity id = wgrt::read_adapter_identity(dev->GetAdapterLuid());
        uint32_t v = 0, dv = 0;
        int32_t st = wgrt::driver_query_status(wgrt::to_luid(dev->GetAdapterLuid()), &v, &dv);
        fprintf(out, "  driver query status=0x%08x kmt_known=%d wine_fallback=%d rdna4=%d\n", (unsigned)st, (int)id.kmt_known,
                (int)id.wine_fallback, (int)wgrt::rdna4_identity(id));
        if (wgrt::rdna4_identity(id)) {
          std::string note = wgrt::wine_fallback_line(id);
          fprintf(out, "  accepted; note: %s\n", note.empty() ? "(none)" : note.c_str());
        } else {
          fprintf(out, "  refused: %s (%s)\n", wgrt::needs_rx9000_sentence(), wgrt::describe_identity(id).c_str());
        }
        dev->Release(); a->Release();
      }
      f->Release(); fclose(out);
      return 0;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions