fix: smarter GPU detection to prefer Intel XPU over AMD iGPU#345
Draft
Kosinkadink wants to merge 1 commit into
Draft
fix: smarter GPU detection to prefer Intel XPU over AMD iGPU#345Kosinkadink wants to merge 1 commit into
Kosinkadink wants to merge 1 commit into
Conversation
When a machine has both an AMD CPU with integrated Radeon graphics (vendor 1002) and an Intel Arc discrete GPU (vendor 8086), the old pickGPU() priority (NVIDIA > AMD > Intel) would incorrectly select AMD even though the AMD device is just an iGPU incapable of ROCm. Changes: - pickGPU() now accepts rich GpuDevice[] with name/VRAM/discrete info - New isAmdIgpu() heuristic classifies AMD GPUs as integrated vs discrete using device name patterns, VRAM size, and sysfs boot_vga attribute - Priority is now: NVIDIA > discrete AMD > Intel (XPU) > AMD iGPU > CPU - Windows WMI query expanded to fetch Name + AdapterRAM per controller - Linux lspci parser extracts device descriptions for name-based heuristics - Linux sysfs reader uses boot_vga attribute to flag integrated GPUs - Comprehensive unit tests for isAmdIgpu and pickGPU covering the bug scenario Fixes #342 Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d2dfc-3f03-760c-b05d-f88aae3ea22e
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
When a machine has an AMD CPU with integrated Radeon graphics (vendor
1002) and an Intel Arc discrete GPU (vendor8086), the oldpickGPU()priority (NVIDIA > AMD > Intel) incorrectly selects AMD — even though the AMD device is just an iGPU incapable of ROCm, and the user's actual compute GPU is the Intel Arc XPU.Fixes #342
Changes
Core logic
pickGPU()now accepts richGpuDevice[]with name, VRAM, and discrete/integrated infoisAmdIgpu()heuristic classifies AMD GPUs using:discreteflag when availableWindows
Name+AdapterRAMperWin32_VideoControllerLinux
lspciparser extracts device descriptions for name-based iGPU heuristicssysfsreader simplified (vendor-only; lspci runs first with richer data)Tests
isAmdIgpuandpickGPUcovering: