Skip to content

fix(xsysinfo): avoid startup hang on intel_gpu_top - #12206

Open
leilei3167 wants to merge 1 commit into
mudler:masterfrom
leilei3167:fix/issue-12205-intel-gpu-top-hang
Open

leilei3167 wants to merge 1 commit into
mudler:masterfrom
leilei3167:fix/issue-12205-intel-gpu-top-hang

Conversation

@leilei3167

Copy link
Copy Markdown
Contributor

Description

This PR fixes #12205

Startup could hang when intel_gpu_top is installed: we invoked intel_gpu_top -J -s 1, but on current intel_gpu_top the -s flag is the refresh period in milliseconds and the default run count is infinite. That left the process sampling every 1 ms until killed.

Use -n 1 for a single JSON sample and cap the subprocess with a 10s timeout so a stuck tool cannot block LocalAI boot.

Notes for Reviewers

  • getIntelGPUTop still returns nil when memory stats are unavailable; this only fixes the blocking call during vendor probing.
  • Regression: intelGPUTopArgs in pkg/xsysinfo/intel_gputop_internal_test.go.

Verify

go test ./pkg/xsysinfo/ -count=1

Old red / new green (same spec): with -s 1 still wired, intelGPUTopArgs spec fails; with -n 1, go test ./pkg/xsysinfo/ passes.

Signed commits

  • Yes, I signed my commits.
  • Documentation updated (docs/content/) for user-facing changes, or not applicable

Use -n 1 for a single JSON sample instead of -s 1, which sets a 1 ms
refresh period and runs until interrupted on current intel_gpu_top.

Fixes mudler#12205

Signed-off-by: leilei3167 <imleilei123@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Endless loop during startup

1 participant