Laptop with an RTX 4060 and a Radeon 610M: the layer chose the 512 MB iGPU by default (15,683 MB budget of shared RAM), and every run on it ended in a device removal #3034
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by ffaddd-ddd on 2026-12-02T03:18:48Z.
AI use: written by DeepSeek (deepseek-v4.1-flash) from the reporter's logs; every figure below is quoted from them.
Summary
On a laptop with an Intel/AMD iGPU and an RTX 4060, the layer picked the iGPU by default and ran the title on it. The iGPU is a Radeon 610M with 512 MB; it reports a 15,683 MB budget from shared system memory, so nothing in the counters looks wrong until you check the driver stamp. Every run on it ended in a device removal. With
-Adapter 4060the same build runs.This may be worth a guard: the adapter choice is silent, and the failure it produces looks like the memory and pipeline bugs already tracked, not like a wrong-GPU problem.
How I found it
PR #2789(driver stamp) writescache/pipelines/host-pipelines.driver. After a run that crashed I read it:0x1002is AMD,0x164eis this machine's Radeon 610M. The two cards here:With
-Adapter 4060the same file says:And the video memory line changes, which is the second tell:
15683 MBon an 8 GB laptop is not a real card. The iGPU's budget is shared system memory, so the layer plans against a figure no texture can fill, and every memory counter derived from it is meaningless.What it does on the iGPU
Three runs, all
-Resolution 1080 -Adapternot given:-Resolution 1080 -FrameGen 60x887A0005after 2 min 52 s-Resolution 1080 -NoDlss-Resolution 1080 -FrameGen 20x80000003after ~15 sFrom the iGPU runs' log:
1.34e8and2.6e8in heaps that hold 2,097,152 views: the descriptors are garbage. I assumed that was a shader or heap bug until the driver stamp said the card was the iGPU.What it does on the 4060
Same build,
-Adapter 4060,-Dlss quality -FrameGen 2(Series S, 1280x720 in, 1920x1080 out):The world runs. Frame generation is working (
tagged=true,per=2). It still ends in0x887A0005eventually, which is the bug in #2821 / #3012, not this one.Frame-time measurements on the 4060 (145 samples under 250 ms)
Two things worth noting for the frame-rate work:
The GPU is 1% of the frame. This is the submit-thread wall README already names; at 3,005 draws a frame (P50) the copies alone are 13.0 ms.
Frame generation doubles the frames but not the smoothness: P10 to P90 is 35 to 99 ms, so the shown 31 fps arrives on a 15 fps beat. I am not reporting this as a bug — it is what 2x does above a jittery render — but it is why "more frames" did not feel better here.
There are also 28 stalls of 500 ms or more (the worst 7.0 s) as pipelines are made on first sight. Those are the precompile gap, not this issue.
What I would ask for
Is "Windows' default card" the right default on a hybrid laptop?
play-nvidia.ps1documents it that way ("Default: Windows' default card"), and here Windows' default was the 512 MB Radeon 610M, whose reported budget is 15,683 MB of shared system memory — larger than the 8 GB card's 7,188 MB. Whatever the layer reads to pick the default, on this machine it landed on the iGPU; a start that names the adapter it took, or a default that prefers the discrete card, would have saved three runs.Could the start say which adapter it took, one line, when more than one is present?
host-pipelines.drivernow answers it after a run, but a first start with no cache has nothing to read.Should a budget larger than the card's dedicated memory be refused or flagged? A 15,683 MB budget on a machine whose discrete card has 8,188 MiB is the shape of the problem; the layer built its whole memory plan on it.
Environment
Related
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T06:59:21Z.
finding: source trace of why the iGPU is chosen silently by default and reports shared RAM as local budget (checked on
mainf37c4a87d, source-only -- no dual-GPU laptop locally).Default adapter selection (
d3d12/crates/leonida-gpu/src/host.rs:1488-1499):When
LEONIDA_ADAPTERandLEONIDA_D3D12_WARPare unset,chosen_adapter()returnsNoneandhost.rs:1496callsD3D12CreateDevice(None, D3D_FEATURE_LEVEL_12_0, &mut device). PassingNoneasks DXGI for adapter 0 (Windows' default display adapter -- on hybrid AMD/NVIDIA laptops, the 512 MB iGPU unless overridden in Windows Graphics Settings), instead of queryingIDXGIFactory6::EnumAdapterByGpuPreference(0, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE).Silent selection on the default path (
host.rs:1565-1568vs1628-1633):host.rs:1565-1567already queries the chosenIDXGIAdapter3viaEnumAdapterByLuid(device.GetAdapterLuid()), but line1568only logstracing::info!("host D3D12 device ready")without the adapter name,VendorId/DeviceId, orDedicatedVideoMemory. The adapter name andDedicatedVideoMemoryare currently logged only insidechosen_adapter()(host.rs:1628-1633) whenLEONIDA_ADAPTERis explicitly set.Why the 512 MB iGPU logged
budget 15683 MBas "the card's own" (host.rs:14350-14426):Host::video_memory()/log_video_memory()queriesDXGI_MEMORY_SEGMENT_GROUP_LOCALand labels it "the card's own". On UMA/integrated adapters, WDDM maps half of system RAM intoDXGI_MEMORY_SEGMENT_GROUP_LOCALeven thoughDXGI_ADAPTER_DESC1::DedicatedVideoMemoryis only 512 MB, so downstream residency/pool sizing treats shared system RAM as dedicated VRAM.Concrete fix direction:
LEONIDA_ADAPTERis unset, preferIDXGIFactory6::EnumAdapterByGpuPreference(0, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE)(skippingDXGI_ADAPTER_FLAG_SOFTWARE), falling back to the hardware adapter with the largestDedicatedVideoMemoryifIDXGIFactory6is unavailable, and finallyNone. KeepLEONIDA_ADAPTERas the explicit override (allowing intentional iGPU selection).Description,VendorId/DeviceId,DedicatedVideoMemory,SharedSystemMemory, plus the enumerated hardware adapter list when >1 exists) right afterEnumAdapterByLuidathost.rs:1568.DedicatedVideoMemory(e.g.,< 4 GiB) while a larger dedicated hardware adapter is present, or ifDXGI_MEMORY_SEGMENT_GROUP_LOCALbudget greatly exceedsDedicatedVideoMemory(UMA adapter).AI-assisted: yes (Antigravity).
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T13:34:33Z.
This is the same thing I measured on a desktop, and the guard you propose is the one piece still missing from the fixes. I am taking it.
Measured here, Ryzen 7 7800X3D with an RTX 4090 beside the Radeon iGPU -
D3D12CreateDevice(None, ..), what the layer uses when no card is named:vendor=0x1002, the same vendor yourhost-pipelines.driverstamp shows);NVSDK_NGX_Result_FAIL_FeatureNotSupported, which reads like a driver problem and is not one;Your report is the third one of the same shape (#3034 here, #2907's "dlss not even working", #2762), and they all read as different bugs until someone prints the vendor.
What is already in the tree
-Adapter 4090)", with the vendor measurement behind it.play-nvidia.ps1says it when DLSS is asked for and no-Adapteris given.dlss::initwarns instead of asking the SDK, when the device's vendor is not NVIDIA: "DLSS asked for and this device is not an NVIDIA card: the upscale stays a stretch (name the card: LEONIDA_ADAPTER, or the launcher's -Adapter)".None of those is the guard: they all speak when something else already went wrong (DLSS asked, a script run, a test). The choice itself is still silent, which is your point.
The guard, as I would write it
In
Host's device creation, after the default-adapter path: look at the card the device landed on, compare itsDedicatedVideoMemorywith the largest one DXGI lists, and when another adapter has more, log one line naming both - "the host device is on (N MB of its own); has <M MB. Name the card withLEONIDA_ADAPTER, or the launcher's-Adapter". No change of device (a user may want the integrated one, and the repo does not pick for people), no WMI, no cost when there is one card.I have the machine to verify it both ways (iGPU default and
-Adapter 4090), and I will open it as a pull request that references this issue.And until it lands, the workaround for a laptop like yours is
-Adapter 4060onplay-nvidia.ps1- part of the name is enough.AI-assisted: yes - DeepSeek v4.1 (flash).
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T13:42:12Z.
The guard this issue asks for is #3141, as promised above.
What it does, in
Host's device creation on the default branch: compares the card the device landed on with the one that holds the mostDedicatedVideoMemoryof its own, and when another has more, logs one line naming both:It does not change the device - the repo does not pick a card for people - and it costs nothing on a one-card PC: the same DXGI enumeration
LEONIDA_ADAPTERalready does, no WMI.Verified here both ways: the ignored test asserts that the card it calls small really holds less than the one it names, and that the biggest card is never named beside another.
cargo test -p leonida-gpu --lib -- --ignored bigger_cardpasses on the 4090 machine; clippy is back to the single warningmainalready has.With that, the four pieces are: the README (merged), the launcher's note (#2999), the layer's DLSS warning (#2993), and this one for every other path that ends up on the wrong card without asking DLSS.
AI-assisted: yes - DeepSeek v4.1 (flash).
Written with an AI assistant.