Repository navigation
xe: place small CPU-mapped VRAM BOs in the visible window on small-BAR devices - #1046
Open
joshuaswarren wants to merge 2 commits into
Open
joshuaswarren wants to merge 2 commits into
joshuaswarren wants to merge 2 commits into
Conversation
…ll-BAR devices On a device without resizable BAR, a VRAM BO that is not placed in the CPU-visible window raises SIGBUS on the first CPU access. NEO hits this when it copies the SIP kernel into its allocation and when clCreateBuffer copies a host pointer into a VRAM BO. Request DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM for VRAM-placed BOs up to 16 MiB. The kernel treats the flag as a no-op on full-BAR devices.
Author
|
Pushed a second commit: the memory-info create path (the one that takes |
Author
|
On a 16-inch M1 Max, the patched runtime enumerated an Arc Pro B60 and built an OpenCL kernel. Kernel execution still returned CL_OUT_OF_RESOURCES, and the current PR head has not been runtime-tested. What additional test would help review? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: on an Arc Pro B60 without resizable BAR (USB4 eGPU, aarch64 host), NEO dies with SIGBUS in
DrmMemoryManager::copyMemoryToAllocationBanks. gdb shows the fault on the first byte store into a fresh GEM mmap, so the kernel could not back the page: the BO sits in VRAM outside the CPU-visible window.The same fault later hits
clCreateBufferwith a host pointer (copyHostPointer, 2 MiB BO).Change: request
DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAMfor VRAM-placed BOs up to 16 MiB. The xe uAPI documents the flag as a no-op on full-BAR devices. The size limit keeps large allocations from using up the visible window; it stands in for "CPU-mapped" becausecreateGemExtdoes not know the mapping intent. A map-intent hint from the caller would be cleaner, if you prefer that.Test: with this change plus two local aarch64 build fixes,
clinfolists the B60 and anonline_test(clBuildProgramwith IGC) printsONLINE_BUILD_OK. Kernel execution then fails separately (clEnqueueNDRangeKernelreturns -5); that is not part of this PR. I built and tested against an older pinned tree, not this master, and I did not run the unit tests.