Skip to content

feat(nvidia): captured the graphics engine's golden context at bring-up - #602

Merged
FlareCoding merged 1 commit into
pr/nvidia-graphics-layoutsfrom
pr/nvidia-graphics-golden
Nov 7, 2026
Merged

FlareCoding merged 1 commit into
pr/nvidia-graphics-layoutsfrom
pr/nvidia-graphics-golden

Conversation

@FlareCoding

@FlareCoding FlareCoding commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

Every graphics channel's context starts from the golden context, which the firmware captures from the first channel given a 3D object, so the NVIDIA backend captures it at bring-up, on a channel of its own, before the GPU registers with the GPU core.

Changes

  • Every graphics queue starts from one captured state: engines::bring_up_graphics, which the driver task runs between bring_up and registration, allocates the graphics engine's global context buffers and captures the golden context on a channel of its own: it maps the channel's own buffers and the global ones into the channel's address space, hands them to the firmware (the promotion), then gives the channel a 3D object and frees it. The global buffers, about 10 MiB on the RTX 3080, stay allocated for the graphics channels that share them. A failure leaves the GPU unregistered, and memory the firmware or a hung copy may still reach stays allocated for good.
  • The capture runs in an address space the firmware shares: the firmware refuses the golden context's promotion in an address space only the kernel maps, so address_space::create_split creates one split between them, handing the firmware the kernel's page directories above its range (context_page_tables::add_directories).
  • Only the GPU's privileged accesses reach the buffers: a privilege bit in page_mapping maps the context buffers so that only the GPU's privileged accesses, such as a context switch's, reach them, and the register access map read-only.
  • A channel is built in steps: channel::create is split into allocate, add_object and schedule, so the golden channel's buffers are promoted between its allocation and its 3D object and the channel is never scheduled.
  • Tests: kernel tests pin the page entry's privilege bit, the buffers' placement and privileged mappings, the split space's setup, the channel's steps, and the capture's order with what it gives back or keeps when the firmware or video memory refuses a step (the layouts' read, an allocation, the directories' handover, the promotion, the 3D object or a release), when a reply misses its deadline, and when a zeroing hangs. A mutation sweep of the capture kills 4 of 5 mutants, the other equivalent. On the RTX 3080 bring-up captures the golden context on channel 1 of runlist 0 with a 1448 KiB main buffer, the GPU registers with the GPU core, and gputest's 78 checks pass.

Every graphics channel's context starts from the golden context, which the firmware captures from the first channel
given a 3D object. Capturing it at bring-up, on a channel of its own in a split address space since the firmware
refuses the golden context's promotion in one only the kernel maps, gives every graphics queue the same starting
state.
@FlareCoding
FlareCoding added this pull request to stack #608 November 7, 2026 18:17
@FlareCoding
FlareCoding merged commit 3570a82 into master Nov 7, 2026
10 checks passed
@FlareCoding
FlareCoding deleted the pr/nvidia-graphics-golden branch November 7, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant