fix: retry NvAPI init on autoload to handle early boot race #3

Merged
Pakobbix merged 1 commits from fix/autoload-nvapi-retry into main 2026-08-09 06:29:59 +00:00
Collaborator

Auto-load profiles were not applied after reboot due to a race condition: the daemon starts before the NVIDIA driver is fully initialized, causing init_nvapi() to fail instantly.

Two bugs:\n\n1. init_nvapi() called sys.exit(1) directly, which raises SystemExit — not caught by except Exception\n2. No retry logic around NvAPI initialization\n\nFix:\n- init_nvapi() now raises RuntimeError so callers can handle the failure\n- run_autoload() retries NvAPI init up to 16 times (2s interval, 32s total wait)

Auto-load profiles were not applied after reboot due to a race condition: the daemon starts before the NVIDIA driver is fully initialized, causing `init_nvapi()` to fail instantly. **Two bugs:**\n\n1. `init_nvapi()` called `sys.exit(1)` directly, which raises `SystemExit` — not caught by `except Exception`\n2. No retry logic around NvAPI initialization\n\n**Fix:**\n- `init_nvapi()` now raises `RuntimeError` so callers can handle the failure\n- `run_autoload()` retries NvAPI init up to 16 times (2s interval, 32s total wait)
ARIA added 1 commit 2026-08-09 06:29:09 +00:00
init_nvapi() previously called sys.exit(1) directly, which raised
SystemExit (uncaught by except Exception). The autoload subprocess
would die instantly if the NVIDIA driver wasn't fully loaded at boot.

- Raise RuntimeError from init_nvapi() so callers can handle failures
- Add 16-attempt retry loop (2s interval, 32s total) in run_autoload()
Collaborator

✅ No issues found — changes look consistent with the stated intent. Ready to be merged.

✅ No issues found — changes look consistent with the stated intent. Ready to be merged.
Pakobbix merged commit af23a10f25 into main 2026-08-09 06:29:59 +00:00
Pakobbix deleted branch fix/autoload-nvapi-retry 2026-08-09 06:29:59 +00:00
Sign in to join this conversation.