Repository navigation
intel: do not require PCI enable count to be exactly 1 - #554
Merged
Merged
Conversation
`/sys/bus/pci/devices/.../enable` exposes pci_dev.enable_cnt, the number of times pci_enable_device() has been called, not a boolean. Integrated GPUs commonly have a count greater than one (e.g. Meteor Lake-P reports 3), so requiring the string "1" caused nvtop to discard a working GPU during enumeration. The count is not a reliable proxy for usability either: xe drops it during D3cold runtime suspend while keeping the driver bound, so a device that is currently disabled may still be perfectly functional. Rely on the bound i915/xe driver instead. Fixes: #553 See also: #465, #498
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.
Summary
Intel GPUs are discarded during enumeration when
/sys/bus/pci/devices/<pci>/enableis not exactly"1":That attribute is not a boolean. It exposes
pci_dev.enable_cnt, the number of timespci_enable_device()has been called:drivers/pci/pci-sysfs.c:enable_show()emitsatomic_read(&pdev->enable_cnt).drivers/pci/pci.c:pci_enable_device_flags()doesatomic_inc_return(&dev->enable_cnt).include/linux/pci.h:pci_is_enabled()isenable_cnt > 0.Integrated GPUs commonly have a count greater than one. On the affected Meteor Lake-P machine it is
3, so nvtop never registers the GPU and printsNo GPU to monitor.The value is also not a stable indicator of usability:
xe_pci_runtime_suspend()andxe_pci_suspend()callpci_disable_device()for D3cold while the driver remains bound, so the count can be zero for a perfectly functional, idle GPU.After the existing Intel vendor and
i915/xedriver checks, the bound driver is the reliable signal: both drivers enable the device during probe (i915_driver_probe()callspci_enable_device(),xe_pci_probe()callspcim_enable_device()), and probe failure prevents binding. This removes the redundant and fragileenablecheck.Testing
-DINTEL_SUPPORT=ON.nvtop -sstill works normally on the non-Intel GPU of the development machine.Fixes #553
See also #465, #498 (not confirmed to share this root cause).