fix: remove hardcoded HSA_OVERRIDE_GFX_VERSION for RX 7000#736
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR removes the unconditional HSA_OVERRIDE_GFX_VERSION fallback, documents AMD import-order for ChangesAMD GPU Configuration Documentation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
1cd05a3 to
8c4a7e0
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
backend/app.py (1)
44-44: ⚡ Quick winSplit imports onto separate lines.
Per PEP 8 and Ruff E401, imports should be on separate lines for readability.
📦 Proposed fix
- import subprocess, re + import re + import subprocess🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@backend/app.py` at line 44, The import statement "import subprocess, re" should be split into separate lines to satisfy PEP 8 / Ruff E401; replace the single combined import with two distinct imports (e.g., separate import subprocess and import re) in backend/app.py where the current combined import appears so each module is imported on its own line.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/app.py`:
- Around line 52-55: The version-parsing code in backend/app.py currently uses
major.lstrip('0')/minor.lstrip('0')/patch.lstrip('0') which removes all leading
zeros incorrectly (e.g., "10" → "1"); change the logic to parse each slice as an
integer then convert back to string (e.g., int(major_slice) or 0) so gfx (the
gfx variable and the slices assigned to major/minor/patch) yields correct
version strings when building version in the version = f"...{...}.{...}.{...}"
expression; update the expressions that compute major, minor, patch and the
final version formation accordingly to use int(...) safely and fallback to 0.
---
Nitpick comments:
In `@backend/app.py`:
- Line 44: The import statement "import subprocess, re" should be split into
separate lines to satisfy PEP 8 / Ruff E401; replace the single combined import
with two distinct imports (e.g., separate import subprocess and import re) in
backend/app.py where the current combined import appears so each module is
imported on its own line.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Replaces the hardcoded HSA_OVERRIDE_GFX_VERSION=10.3.0 (RX 6000 series) with dynamic detection using rocminfo. This enables out-of-the-box support for newer GPUs like RX 7000 series (gfx1100 / RDNA 3). Logic: - If user already set HSA_OVERRIDE_GFX_VERSION, respect it - Otherwise run rocminfo and parse gfxXXXX string - Convert gfx1100 → 11.0.0, gfx1030 → 10.3.0, etc. - If rocminfo fails or is missing, fall through silently Verified on: - Linux + ROCm 7.2.1 + RX 7900 XTX (gfx1100) - Backend correctly detects: GPU: ROCm (Radeon RX 7900 XTX)
8c4a7e0 to
0085cb9
Compare
Problem
The current
backend/app.pyhardcodesHSA_OVERRIDE_GFX_VERSION=10.3.0, which is the value for RX 6000 series (RDNA 2).On newer GPUs like the RX 7900 XTX (gfx1100, RDNA 3), this prevents ROCm 7.2+ from auto-detecting the correct architecture, causing GPU initialization issues.
Solution
Remove the hardcoded default. ROCm 7.2+ auto-detects gfx architecture natively.
Users with older GPUs can still set HSA_OVERRIDE_GFX_VERSION manually if needed.
Testing
Verified on Linux + ROCm 7.2.1 + RX 7900 XTX:
Impact
HSA_OVERRIDE_GFX_VERSION=10.3.0if neededSummary by CodeRabbit
Documentation
Changes