Repository navigation
[Engine] AMD: skip the integrated GPU when a discrete one exists - #333
Merged
Merged
Conversation
…xists Some setups (WSL, ROCm 10.2) list the Ryzen iGPU as HIP device 0, and the engine used device 0, so rocBLAS aborted there. HIP_VISIBLE_DEVICES / ROCR_VISIBLE_DEVICES still choose exactly. One log line says which device and why. CUDA and Metal unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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 and result
On some AMD setups the Ryzen iGPU is listed as HIP device 0 in front of the real card (seen on WSL with ROCm 10.2; ROCm 7.2.4 hid it).
strata-polyused device 0, and rocBLAS aborted on the iGPU (gfx1036).Now, on HIP builds, an integrated device (
hipDeviceProp_t.integrated, or arch gfx90c/gfx1035/gfx1036/gfx1103/gfx1150-1153) is left out when a discrete device exists. One line on stderr says what was chosen:strata-poly: GPU device 1 of 2: skipped 1 integrated device(s); set HIP_VISIBLE_DEVICES to choose by handHIP_VISIBLE_DEVICES,ROCR_VISIBLE_DEVICES,CUDA_VISIBLE_DEVICESorGPU_DEVICE_ORDINALsetCUDA and Metal are unchanged (the new code is compiled only for HIP). The same code serves the Qwen models, since they run in the same
Engine.Related discussion
None.
Approach
device_pick.hpp: the choice as a pure function over a device list.engine.cpp:device_ids()reads the devices once on HIP;Engine::opensets the first one, and a layer split (andSTRATA_POLY_CARDS) maps its parts onto that list in turn.--expert-gpustill takes a raw device index.Validation
Passed:
poly_device_pick_test(no GPU): iGPU first, iGPU second, only an iGPU, two discrete, flag-only iGPU, arch with:xnack-suffix, env override.GPU device 0 of 2: skipped 1 integrated device(s)HIP_VISIBLE_DEVICES=1,0(iGPU first)HIP_VISIBLE_DEVICES=1,0Failed:
Not run:
Limits
integratednor a listed arch would still be seen as discrete; useHIP_VISIBLE_DEVICESthen.HIP_VISIBLE_DEVICES=0,1.--expert-gpu Nand the separate Qwen 3.6 engine (qwen35/) are not changed.🤖 Generated with Claude Code