-
Notifications
You must be signed in to change notification settings - Fork 11
fix: add missing modprobe params for cosim amdgpu driver init #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3ad8e90
fix: add missing modprobe params for cosim amdgpu driver init
zevorn 3ba3311
fix(scripts): remove runtime blacklist before modprobe in cosim_guest…
zevorn 39b86f1
fix: shellcheck compliance and add modprobe params regression test
zevorn 94c8e9a
fix(tests): add audio=0 to required modprobe params check
zevorn 89c1fe6
fix: check each modprobe path independently and avoid full submodule …
zevorn ec2e9d6
fix(ci): use HTTPS for submodule clone in modprobe-params job
zevorn 6164191
fix(tests): match all modprobe/insmod amdgpu lines, not just ip_block…
zevorn 4533e13
fix(tests): use exact token matching for modprobe param values
zevorn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| #!/bin/bash | ||
| # Regression test: ensure all cosim modprobe/insmod commands include the | ||
| # required parameters. Missing ppfeaturemask/dpm/audio causes -EINVAL | ||
| # on ROCm 7.0+ (see issue #9). | ||
| # | ||
| # Two checks per file: | ||
| # 1. If AMDGPU_ARGS is defined, its definition must contain all params. | ||
| # 2. Every inline modprobe/insmod amdgpu line (with literal params, not | ||
| # a variable reference) must also contain all params independently. | ||
|
|
||
| set -uo pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| REPO_ROOT="$(dirname "$SCRIPT_DIR")" | ||
|
|
||
| REQUIRED_PARAMS=( | ||
| "ip_block_mask=0x67" | ||
| "ppfeaturemask=0" | ||
| "dpm=0" | ||
| "audio=0" | ||
| "ras_enable=0" | ||
| "discovery=2" | ||
| ) | ||
|
|
||
| FAILED=0 | ||
| CHECKED=0 | ||
|
|
||
| check_line() { | ||
| local file="$1" | ||
| local lineno="$2" | ||
| local line="$3" | ||
|
|
||
| CHECKED=$((CHECKED + 1)) | ||
| for param in "${REQUIRED_PARAMS[@]}"; do | ||
| if ! echo " $line " | tr '()"'"'"'' ' ' | grep -qF " $param "; then | ||
| echo "FAIL: ${file}:${lineno} missing '${param}'" | ||
| echo " line: ${line}" | ||
| FAILED=$((FAILED + 1)) | ||
| return | ||
| fi | ||
| done | ||
| } | ||
|
|
||
| check_file() { | ||
| local filepath="$1" | ||
| local contents | ||
| contents="$(cat "$filepath")" | ||
| local lineno=0 | ||
|
|
||
| while IFS= read -r line; do | ||
| lineno=$((lineno + 1)) | ||
| [[ "$line" =~ ^[[:space:]]*# ]] && continue | ||
|
|
||
| if [[ "$line" =~ ^[[:space:]]*AMDGPU_ARGS= ]]; then | ||
| check_line "$filepath" "$lineno" "$line" | ||
| continue | ||
| fi | ||
|
|
||
| # Match modprobe/insmod amdgpu lines, but skip lines that pass | ||
| # params via a variable (e.g., "${AMDGPU_ARGS[@]}") — those are | ||
| # validated through the AMDGPU_ARGS definition check above. | ||
| if echo "$line" | grep -qE '(modprobe|insmod).*amdgpu' && | ||
| ! echo "$line" | grep -qF 'AMDGPU_ARGS'; then | ||
| check_line "$filepath" "$lineno" "$line" | ||
| fi | ||
| done <<< "$contents" | ||
| } | ||
|
|
||
| COSIM_SCRIPTS=( | ||
| "$REPO_ROOT/scripts/cosim_guest_setup.sh" | ||
| "$REPO_ROOT/gem5-resources/src/x86-ubuntu-gpu-ml/files/cosim-gpu-setup.sh" | ||
| ) | ||
|
|
||
| for script in "${COSIM_SCRIPTS[@]}"; do | ||
| if [[ -f "$script" ]]; then | ||
| check_file "$script" | ||
| else | ||
| echo "SKIP: ${script} not found (submodule not checked out?)" | ||
| fi | ||
| done | ||
|
|
||
| echo "" | ||
| echo "Checked $CHECKED definitions/invocations, $FAILED failures." | ||
|
|
||
| if [[ $FAILED -gt 0 ]]; then | ||
| echo "FAIL: Missing required modprobe parameters (see issue #9)." | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ $CHECKED -eq 0 ]]; then | ||
| echo "WARN: No modprobe parameter definitions found." | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "PASS: All cosim modprobe commands include required parameters." | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.