if no amdgpu module initstate. also check if it's built directly into kernel#2689
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds fallback detection for the amdgpu driver when it's compiled directly into the kernel (CONFIG_DRM_AMDGPU=y) instead of as a loadable module, fixing issue #172 where amd-smi failed to initialize in such configurations.
Changes:
- Added built-in driver detection by checking for AMD GPU devices in
/sys/class/drmwhen module check fails - Verifies both vendor ID (0x1002) and driver name ("amdgpu") for proper identification
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
adam360x
approved these changes
Jan 27, 2026
marifamd
approved these changes
Jan 27, 2026
… looking for loaded AMD GPU devices @ /sys/class/drm fixes ROCm/amdsmi#172 issue: If `amdgpu` module `inistate` is not found, `amd-smi` will fail to initialise even if `amdgpu` is built into the kernel (not as a module. but with `CONFIG_DRM_AMDGPU=y`) fix: also check for AMD GPU devices at `/sys/class/drm` if `amdgpu` is built-in to the kernel, loaded, and GPU is there could be made more elegant i guess
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.
fixes ROCm/amdsmi#172
If
amdgpumoduleinistateis not found,amd-smiwill fail to initialise even ifamdgpuis built into the kernel (not as a module. but withCONFIG_DRM_AMDGPU=y)so let's also check for AMD GPU devices at
/sys/class/drmifamdgpuis built-in to the kernel, loaded, and GPU is theremarifamd asked me to make the PR here
could be made more elegant i guess, but this fixes the issue for me.