Skip to content

if no amdgpu module initstate. also check if it's built directly into kernel#2689

Merged
JeniferC99 merged 3 commits into
ROCm:developfrom
hairetikos:patch-1
Feb 5, 2026
Merged

if no amdgpu module initstate. also check if it's built directly into kernel#2689
JeniferC99 merged 3 commits into
ROCm:developfrom
hairetikos:patch-1

Conversation

@hairetikos

Copy link
Copy Markdown
Contributor

fixes ROCm/amdsmi#172

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)

so let's also check for AMD GPU devices at /sys/class/drm if amdgpu is built-in to the kernel, loaded, and GPU is there

marifamd asked me to make the PR here

could be made more elegant i guess, but this fixes the issue for me.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/drm when 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.

Comment thread projects/amdsmi/amdsmi_cli/amdsmi_init.py Outdated
Comment thread projects/amdsmi/amdsmi_cli/amdsmi_init.py Outdated
Comment thread projects/amdsmi/amdsmi_cli/amdsmi_init.py Outdated
hairetikos and others added 3 commits February 3, 2026 14:33
… 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
@JeniferC99 JeniferC99 merged commit 81ac44a into ROCm:develop Feb 5, 2026
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

amdgpu not found in modules (i have it built into the kernel)

5 participants