amd-debug-tools 0.2.21__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/.github/workflows/ci.yml +56 -5
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/.gitignore +1 -0
- amd_debug_tools-0.3.0/.pre-commit-config.yaml +10 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/PKG-INFO +47 -26
- amd_debug_tools-0.3.0/README.md +69 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/amd_bios.py +3 -4
- amd_debug_tools-0.3.0/amd_power.py +33 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/amd_pstate.py +3 -4
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/amd_s2idle.py +3 -4
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/amd_ttm.py +3 -4
- amd_debug_tools-0.3.0/codecov.yml +2 -0
- amd_debug_tools-0.3.0/docs/amd-bios.md +46 -0
- amd_debug_tools-0.3.0/docs/amd-power.md +93 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/docs/amd-s2idle.md +32 -3
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/docs/in-tree.md +1 -0
- amd_debug_tools-0.3.0/docs/platform-support.md +187 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/install_deps.py +3 -4
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/psr.py +11 -14
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/pyproject.toml +7 -3
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/__init__.py +8 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/acpi.py +8 -5
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/bash/amd-s2idle +31 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/bios.py +46 -6
- amd_debug_tools-0.3.0/src/amd_debug/bios_tui.py +529 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/common.py +91 -31
- amd_debug_tools-0.3.0/src/amd_debug/cpu.py +84 -0
- amd_debug_tools-0.3.0/src/amd_debug/database.py +800 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/display.py +2 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/failures.py +98 -14
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/installer.py +57 -24
- amd_debug_tools-0.3.0/src/amd_debug/intel.py +320 -0
- amd_debug_tools-0.3.0/src/amd_debug/ivrs.py +486 -0
- amd_debug_tools-0.3.0/src/amd_debug/ivrs_fixtures.py +297 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/kernel.py +8 -6
- amd_debug_tools-0.3.0/src/amd_debug/nvidia.py +263 -0
- amd_debug_tools-0.3.0/src/amd_debug/power.py +363 -0
- amd_debug_tools-0.3.0/src/amd_debug/power_db.py +144 -0
- amd_debug_tools-0.3.0/src/amd_debug/power_query.py +250 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/power_rails.py +14 -4
- amd_debug_tools-0.3.0/src/amd_debug/power_service.py +212 -0
- amd_debug_tools-0.3.0/src/amd_debug/prereq/__init__.py +49 -0
- amd_debug_tools-0.3.0/src/amd_debug/prereq/acpi.py +143 -0
- amd_debug_tools-0.3.0/src/amd_debug/prereq/amd.py +50 -0
- amd_debug_tools-0.3.0/src/amd_debug/prereq/amd_gpu.py +269 -0
- amd_debug_tools-0.3.0/src/amd_debug/prereq/amd_platform.py +344 -0
- amd_debug_tools-0.3.0/src/amd_debug/prereq/amd_storage.py +183 -0
- amd_debug_tools-0.3.0/src/amd_debug/prereq/base.py +210 -0
- amd_debug_tools-0.3.0/src/amd_debug/prereq/base_headers.py +18 -0
- amd_debug_tools-0.3.0/src/amd_debug/prereq/devices.py +217 -0
- amd_debug_tools-0.3.0/src/amd_debug/prereq/intel.py +208 -0
- amd_debug_tools-0.3.0/src/amd_debug/prereq/nvidia.py +233 -0
- amd_debug_tools-0.3.0/src/amd_debug/prereq/system.py +237 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/pstate.py +22 -11
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/s2idle-hook +3 -3
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/s2idle.py +157 -29
- amd_debug_tools-0.3.0/src/amd_debug/s2idle_tui.py +1401 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/sleep_report.py +61 -30
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/templates/html +1 -1
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/templates/stdout +1 -1
- amd_debug_tools-0.3.0/src/amd_debug/triage.py +827 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/ttm.py +2 -0
- amd_debug_tools-0.3.0/src/amd_debug/tui.py +388 -0
- amd_debug_tools-0.3.0/src/amd_debug/validator/__init__.py +21 -0
- amd_debug_tools-0.3.0/src/amd_debug/validator/analysis.py +186 -0
- amd_debug_tools-0.3.0/src/amd_debug/validator/capture.py +545 -0
- amd_debug_tools-0.3.0/src/amd_debug/validator/core.py +276 -0
- amd_debug_tools-0.3.0/src/amd_debug/validator/intel.py +179 -0
- amd_debug_tools-0.3.0/src/amd_debug/validator/suspend.py +199 -0
- amd_debug_tools-0.3.0/src/amd_debug/validator_headers.py +18 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/wake.py +12 -8
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug_tools.egg-info/PKG-INFO +47 -26
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug_tools.egg-info/SOURCES.txt +54 -4
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug_tools.egg-info/entry_points.txt +2 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug_tools.egg-info/requires.txt +2 -0
- amd_debug_tools-0.3.0/src/amd_debug_tools.egg-info/scm_file_list.json +117 -0
- amd_debug_tools-0.3.0/src/amd_debug_tools.egg-info/scm_version.json +8 -0
- amd_debug_tools-0.3.0/src/amd_debug_tools.egg-info/top_level.txt +37 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/launcher.py +3 -4
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_acpi.py +2 -5
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_batteries.py +2 -3
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_bios.py +16 -10
- amd_debug_tools-0.3.0/src/test_bios_tui.py +484 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_common.py +109 -16
- amd_debug_tools-0.3.0/src/test_cpu.py +204 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_database.py +277 -24
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_display.py +2 -2
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_failures.py +2 -6
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_installer.py +18 -14
- amd_debug_tools-0.3.0/src/test_intel.py +545 -0
- amd_debug_tools-0.3.0/src/test_ivrs.py +341 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_kernel.py +8 -13
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_launcher.py +9 -3
- amd_debug_tools-0.3.0/src/test_nvidia.py +473 -0
- amd_debug_tools-0.3.0/src/test_power.py +312 -0
- amd_debug_tools-0.3.0/src/test_power_db.py +122 -0
- amd_debug_tools-0.3.0/src/test_power_query.py +180 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_power_rails.py +12 -4
- amd_debug_tools-0.3.0/src/test_power_service.py +176 -0
- amd_debug_tools-0.3.0/src/test_prereq_amd.py +1908 -0
- amd_debug_tools-0.3.0/src/test_prereq_amd_storage.py +297 -0
- amd_debug_tools-0.3.0/src/test_prereq_base.py +1474 -0
- amd_debug_tools-0.3.0/src/test_prereq_factory.py +120 -0
- amd_debug_tools-0.3.0/src/test_prereq_intel.py +308 -0
- amd_debug_tools-0.3.0/src/test_prereq_nvidia.py +398 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_pstate.py +20 -16
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_s2idle.py +296 -30
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_sleep_report.py +27 -16
- amd_debug_tools-0.3.0/src/test_triage.py +843 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_ttm.py +4 -4
- amd_debug_tools-0.3.0/src/test_tui.py +866 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_validator.py +890 -79
- amd_debug_tools-0.3.0/src/test_validator_intel.py +325 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/test_wake.py +7 -7
- amd_debug_tools-0.2.21/.github/workflows/mirror.yml +0 -24
- amd_debug_tools-0.2.21/.pre-commit-config.yaml +0 -7
- amd_debug_tools-0.2.21/README.md +0 -50
- amd_debug_tools-0.2.21/docs/amd-bios.md +0 -26
- amd_debug_tools-0.2.21/src/amd_debug/database.py +0 -422
- amd_debug_tools-0.2.21/src/amd_debug/prerequisites.py +0 -1490
- amd_debug_tools-0.2.21/src/amd_debug/validator.py +0 -909
- amd_debug_tools-0.2.21/src/amd_debug_tools.egg-info/scm_file_list.json +0 -67
- amd_debug_tools-0.2.21/src/amd_debug_tools.egg-info/scm_version.json +0 -8
- amd_debug_tools-0.2.21/src/amd_debug_tools.egg-info/top_level.txt +0 -20
- amd_debug_tools-0.2.21/src/test_prerequisites.py +0 -2776
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/.vscode/settings.json +0 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/LICENSE +0 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/Makefile +0 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/docs/amd-pstate.md +0 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/docs/amd-ttm.md +0 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/setup.cfg +0 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/battery.py +0 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/templates/md +0 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug/templates/txt +0 -0
- {amd_debug_tools-0.2.21 → amd_debug_tools-0.3.0}/src/amd_debug_tools.egg-info/dependency_links.txt +0 -0
|
@@ -2,10 +2,9 @@ name: CI
|
|
|
2
2
|
on:
|
|
3
3
|
push:
|
|
4
4
|
pull_request:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
- completed
|
|
5
|
+
|
|
6
|
+
permissions:
|
|
7
|
+
contents: read
|
|
9
8
|
|
|
10
9
|
jobs:
|
|
11
10
|
build:
|
|
@@ -25,6 +24,51 @@ jobs:
|
|
|
25
24
|
name: python-package-distributions
|
|
26
25
|
path: dist/
|
|
27
26
|
|
|
27
|
+
build-deb:
|
|
28
|
+
name: Build Debian package
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
container: debian:unstable
|
|
31
|
+
steps:
|
|
32
|
+
- name: Install build tools
|
|
33
|
+
run: |
|
|
34
|
+
apt-get update
|
|
35
|
+
apt-get install -y --no-install-recommends \
|
|
36
|
+
git ca-certificates build-essential devscripts equivs fakeroot
|
|
37
|
+
- uses: actions/checkout@v4
|
|
38
|
+
with:
|
|
39
|
+
fetch-depth: 0
|
|
40
|
+
- name: Fetch Debian packaging
|
|
41
|
+
run: |
|
|
42
|
+
git clone --depth 1 --branch debian \
|
|
43
|
+
https://salsa.debian.org/debian/amd-debug-tools.git /tmp/salsa
|
|
44
|
+
rm -rf debian
|
|
45
|
+
cp -a /tmp/salsa/debian debian
|
|
46
|
+
- name: Install build dependencies
|
|
47
|
+
run: mk-build-deps -i -r -t "apt-get -y --no-install-recommends" debian/control
|
|
48
|
+
- name: Set version from git describe
|
|
49
|
+
run: |
|
|
50
|
+
git config --global --add safe.directory "$PWD"
|
|
51
|
+
# e.g. 0.2.22-35-gd87a729-0
|
|
52
|
+
desc=$(git describe --tags -a) \
|
|
53
|
+
|| desc=$(dpkg-parsechangelog -S Version | sed 's/-[^-]*$//')
|
|
54
|
+
export DEBFULLNAME="CI" DEBEMAIL="ci@localhost"
|
|
55
|
+
dch --force-bad-version --newversion "${desc}-0" \
|
|
56
|
+
--distribution unstable "Automated CI build of ${desc}"
|
|
57
|
+
# setuptools-scm needs a PEP 440 version
|
|
58
|
+
scm=$(echo "$desc" | sed -E 's/^([0-9.]+)-([0-9]+)-g([0-9a-f]+)$/\1.post\2+g\3/')
|
|
59
|
+
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$scm" >> "$GITHUB_ENV"
|
|
60
|
+
- name: Build binary package
|
|
61
|
+
run: dpkg-buildpackage -us -uc -b
|
|
62
|
+
- name: Collect packages
|
|
63
|
+
run: |
|
|
64
|
+
mkdir -p deb-out
|
|
65
|
+
mv ../*.deb deb-out/
|
|
66
|
+
- name: Store the Debian packages
|
|
67
|
+
uses: actions/upload-artifact@v4
|
|
68
|
+
with:
|
|
69
|
+
name: debian-package
|
|
70
|
+
path: deb-out/
|
|
71
|
+
|
|
28
72
|
publish-to-pypi:
|
|
29
73
|
name: >-
|
|
30
74
|
Publish Python 🐍 distribution 📦 to PyPI
|
|
@@ -52,6 +96,7 @@ jobs:
|
|
|
52
96
|
and upload them to GitHub Release
|
|
53
97
|
needs:
|
|
54
98
|
- publish-to-pypi
|
|
99
|
+
- build-deb
|
|
55
100
|
runs-on: ubuntu-latest
|
|
56
101
|
|
|
57
102
|
permissions:
|
|
@@ -64,12 +109,18 @@ jobs:
|
|
|
64
109
|
with:
|
|
65
110
|
name: python-package-distributions
|
|
66
111
|
path: dist/
|
|
112
|
+
- name: Download the Debian package
|
|
113
|
+
uses: actions/download-artifact@v4
|
|
114
|
+
with:
|
|
115
|
+
name: debian-package
|
|
116
|
+
path: deb/
|
|
67
117
|
- name: Sign the dists with Sigstore
|
|
68
118
|
uses: sigstore/gh-action-sigstore-python@v3.0.0
|
|
69
119
|
with:
|
|
70
120
|
inputs: >-
|
|
71
121
|
./dist/*.tar.gz
|
|
72
122
|
./dist/*.whl
|
|
123
|
+
./deb/*.deb
|
|
73
124
|
- name: Create GitHub Release
|
|
74
125
|
env:
|
|
75
126
|
GITHUB_TOKEN: ${{ github.token }}
|
|
@@ -86,7 +137,7 @@ jobs:
|
|
|
86
137
|
# sigstore-produced signatures and certificates.
|
|
87
138
|
run: >-
|
|
88
139
|
gh release upload
|
|
89
|
-
"$GITHUB_REF_NAME" dist/**
|
|
140
|
+
"$GITHUB_REF_NAME" dist/** deb/**
|
|
90
141
|
--repo "$GITHUB_REPOSITORY"
|
|
91
142
|
|
|
92
143
|
coverage:
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: amd-debug-tools
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: debug tools for AMD systems
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: debug tools for AMD and Intel s2idle systems
|
|
5
5
|
Author-email: Mario Limonciello <superm1@kernel.org>
|
|
6
6
|
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://
|
|
7
|
+
Project-URL: Homepage, https://github.com/amd/amd-linux-debug-tools
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: Operating System :: POSIX :: Linux
|
|
10
|
-
Requires-Python: >=3.
|
|
10
|
+
Requires-Python: >=3.8
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
License-File: LICENSE
|
|
13
13
|
Requires-Dist: dbus-fast
|
|
@@ -21,23 +21,26 @@ Requires-Dist: cysystemd
|
|
|
21
21
|
Requires-Dist: Jinja2
|
|
22
22
|
Requires-Dist: matplotlib
|
|
23
23
|
Requires-Dist: seaborn
|
|
24
|
+
Requires-Dist: plotly
|
|
25
|
+
Requires-Dist: textual
|
|
24
26
|
Dynamic: license-file
|
|
25
27
|
|
|
26
|
-
# Helpful tools for debugging AMD
|
|
27
|
-
[](https://codecov.io/github/rocm/amd-debug-tools)
|
|
28
30
|
[](https://pypi.org/project/amd-debug-tools/)
|
|
29
31
|
|
|
30
|
-
This repository hosts open tools that are useful for debugging issues on
|
|
32
|
+
This repository hosts open tools that are useful for debugging issues on
|
|
33
|
+
systems which use the s2idle (Low Power S0 Idle) suspend state.
|
|
31
34
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
pacman -Sy amd-debug-tools
|
|
35
|
+
Both AMD and Intel platforms are supported. The prerequisites that are
|
|
36
|
+
checked are selected based on the CPU vendor, and the NVIDIA proprietary
|
|
37
|
+
driver is supported on both. See
|
|
38
|
+
[platform support](docs/platform-support.md) for the details.
|
|
37
39
|
|
|
40
|
+
## Installation
|
|
38
41
|
### Using a python wheel (Generic)
|
|
39
42
|
It is suggested to install tools in a virtual environment either using
|
|
40
|
-
`pipx` or `python3 -m venv`.
|
|
43
|
+
`pipx`, `uvx`, or `python3 -m venv`.
|
|
41
44
|
|
|
42
45
|
#### From PyPI
|
|
43
46
|
`amd-debug-tools` is distributed as a python wheel, which is a
|
|
@@ -46,14 +49,6 @@ command:
|
|
|
46
49
|
|
|
47
50
|
pipx install amd-debug-tools
|
|
48
51
|
|
|
49
|
-
### From source
|
|
50
|
-
To build the package from source, you will need to the `python3-build`
|
|
51
|
-
package natively installed by your distribution package manager. Then you
|
|
52
|
-
can generate and install a wheel by running the following commands:
|
|
53
|
-
|
|
54
|
-
python3 -m build
|
|
55
|
-
pipx install dist/amd-debug-tools-*.whl
|
|
56
|
-
|
|
57
52
|
### Ensuring path
|
|
58
53
|
If you have not used a `pipx` environment before, you may need to run the following command
|
|
59
54
|
to set up the environment:
|
|
@@ -62,14 +57,40 @@ to set up the environment:
|
|
|
62
57
|
|
|
63
58
|
This will add the `pipx` environment to your path.
|
|
64
59
|
|
|
60
|
+
### Distro (Arch)
|
|
61
|
+
`amd-debug-tools` has been [packaged for Arch Linux](https://archlinux.org/packages/extra/any/amd-debug-tools/) (and derivatives). You can install it using:
|
|
62
|
+
|
|
63
|
+
pacman -Sy amd-debug-tools
|
|
64
|
+
|
|
65
|
+
### Distro (Debian)
|
|
66
|
+
`amd-debug-tools` has been [packaged for Debian Linux](https://tracker.debian.org/pkg/amd-debug-tools). You can install it using:
|
|
67
|
+
|
|
68
|
+
apt install amd-debug-tools
|
|
69
|
+
|
|
70
|
+
### From source
|
|
71
|
+
To build the package from source, you will need to the `python3-build`
|
|
72
|
+
package natively installed by your distribution package manager. Then you
|
|
73
|
+
can generate and install a wheel by running the following commands:
|
|
74
|
+
|
|
75
|
+
python3 -m build
|
|
76
|
+
pipx install dist/amd-debug-tools-*.whl
|
|
77
|
+
|
|
65
78
|
## Running in-tree
|
|
66
|
-
Documentation about running directly from a git checkout is available [here](https://github.com/
|
|
79
|
+
Documentation about running directly from a git checkout is available [here](https://github.com/rocm/amd-debug-tools/blob/master/docs/in-tree.md).
|
|
67
80
|
|
|
68
81
|
## Tools
|
|
69
82
|
|
|
70
83
|
Each tool has its own individual documentation page:
|
|
71
|
-
* [amd-s2idle](https://github.com/
|
|
72
|
-
* [amd-bios](https://github.com/
|
|
73
|
-
* [amd-pstate](https://github.com/
|
|
74
|
-
* [amd-ttm](https://github.com/
|
|
84
|
+
* [amd-s2idle](https://github.com/rocm/amd-debug-tools/blob/master/docs/amd-s2idle.md)
|
|
85
|
+
* [amd-bios](https://github.com/rocm/amd-debug-tools/blob/master/docs/amd-bios.md)
|
|
86
|
+
* [amd-pstate](https://github.com/rocm/amd-debug-tools/blob/master/docs/amd-pstate.md)
|
|
87
|
+
* [amd-ttm](https://github.com/rocm/amd-debug-tools/blob/master/docs/amd-ttm.md)
|
|
88
|
+
* [amd-power](https://github.com/rocm/amd-debug-tools/blob/master/docs/amd-power.md)
|
|
89
|
+
|
|
90
|
+
## Platform support
|
|
91
|
+
|
|
92
|
+
The s2idle tool supports AMD and Intel platforms, including systems using the
|
|
93
|
+
NVIDIA proprietary driver. See
|
|
94
|
+
[platform support](https://github.com/rocm/amd-debug-tools/blob/master/docs/platform-support.md)
|
|
95
|
+
for the details of what is checked on each platform.
|
|
75
96
|
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Helpful tools for debugging AMD and Intel s2idle systems
|
|
2
|
+
[](https://codecov.io/github/rocm/amd-debug-tools)
|
|
3
|
+
[](https://pypi.org/project/amd-debug-tools/)
|
|
4
|
+
|
|
5
|
+
This repository hosts open tools that are useful for debugging issues on
|
|
6
|
+
systems which use the s2idle (Low Power S0 Idle) suspend state.
|
|
7
|
+
|
|
8
|
+
Both AMD and Intel platforms are supported. The prerequisites that are
|
|
9
|
+
checked are selected based on the CPU vendor, and the NVIDIA proprietary
|
|
10
|
+
driver is supported on both. See
|
|
11
|
+
[platform support](docs/platform-support.md) for the details.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
### Using a python wheel (Generic)
|
|
15
|
+
It is suggested to install tools in a virtual environment either using
|
|
16
|
+
`pipx`, `uvx`, or `python3 -m venv`.
|
|
17
|
+
|
|
18
|
+
#### From PyPI
|
|
19
|
+
`amd-debug-tools` is distributed as a python wheel, which is a
|
|
20
|
+
binary package format for Python. To install from PyPI, run the following
|
|
21
|
+
command:
|
|
22
|
+
|
|
23
|
+
pipx install amd-debug-tools
|
|
24
|
+
|
|
25
|
+
### Ensuring path
|
|
26
|
+
If you have not used a `pipx` environment before, you may need to run the following command
|
|
27
|
+
to set up the environment:
|
|
28
|
+
|
|
29
|
+
pipx ensurepath
|
|
30
|
+
|
|
31
|
+
This will add the `pipx` environment to your path.
|
|
32
|
+
|
|
33
|
+
### Distro (Arch)
|
|
34
|
+
`amd-debug-tools` has been [packaged for Arch Linux](https://archlinux.org/packages/extra/any/amd-debug-tools/) (and derivatives). You can install it using:
|
|
35
|
+
|
|
36
|
+
pacman -Sy amd-debug-tools
|
|
37
|
+
|
|
38
|
+
### Distro (Debian)
|
|
39
|
+
`amd-debug-tools` has been [packaged for Debian Linux](https://tracker.debian.org/pkg/amd-debug-tools). You can install it using:
|
|
40
|
+
|
|
41
|
+
apt install amd-debug-tools
|
|
42
|
+
|
|
43
|
+
### From source
|
|
44
|
+
To build the package from source, you will need to the `python3-build`
|
|
45
|
+
package natively installed by your distribution package manager. Then you
|
|
46
|
+
can generate and install a wheel by running the following commands:
|
|
47
|
+
|
|
48
|
+
python3 -m build
|
|
49
|
+
pipx install dist/amd-debug-tools-*.whl
|
|
50
|
+
|
|
51
|
+
## Running in-tree
|
|
52
|
+
Documentation about running directly from a git checkout is available [here](https://github.com/rocm/amd-debug-tools/blob/master/docs/in-tree.md).
|
|
53
|
+
|
|
54
|
+
## Tools
|
|
55
|
+
|
|
56
|
+
Each tool has its own individual documentation page:
|
|
57
|
+
* [amd-s2idle](https://github.com/rocm/amd-debug-tools/blob/master/docs/amd-s2idle.md)
|
|
58
|
+
* [amd-bios](https://github.com/rocm/amd-debug-tools/blob/master/docs/amd-bios.md)
|
|
59
|
+
* [amd-pstate](https://github.com/rocm/amd-debug-tools/blob/master/docs/amd-pstate.md)
|
|
60
|
+
* [amd-ttm](https://github.com/rocm/amd-debug-tools/blob/master/docs/amd-ttm.md)
|
|
61
|
+
* [amd-power](https://github.com/rocm/amd-debug-tools/blob/master/docs/amd-power.md)
|
|
62
|
+
|
|
63
|
+
## Platform support
|
|
64
|
+
|
|
65
|
+
The s2idle tool supports AMD and Intel platforms, including systems using the
|
|
66
|
+
NVIDIA proprietary driver. See
|
|
67
|
+
[platform support](https://github.com/rocm/amd-debug-tools/blob/master/docs/platform-support.md)
|
|
68
|
+
for the details of what is checked on each platform.
|
|
69
|
+
|
|
@@ -5,10 +5,10 @@ This module is a launcher for the AMD Debug Tools package. It is meant for
|
|
|
5
5
|
launching various tools within the package without installation.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
import sys
|
|
9
8
|
import os
|
|
9
|
+
import sys
|
|
10
10
|
|
|
11
|
-
URL = "
|
|
11
|
+
URL = "https://github.com/amd/amd-linux-debug-tools"
|
|
12
12
|
try:
|
|
13
13
|
import amd_debug
|
|
14
14
|
from amd_debug.common import fatal_error
|
|
@@ -25,8 +25,7 @@ def main():
|
|
|
25
25
|
return amd_debug.launch_tool(os.path.basename(sys.argv[0]))
|
|
26
26
|
except ModuleNotFoundError as e:
|
|
27
27
|
fatal_error(
|
|
28
|
-
f"Missing dependency: {e}\
|
|
29
|
-
f"Run ./install_deps.py to install dependencies."
|
|
28
|
+
f"Missing dependency: {e}\nRun ./install_deps.py to install dependencies."
|
|
30
29
|
)
|
|
31
30
|
|
|
32
31
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/python3
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
"""
|
|
4
|
+
This module is a launcher for the AMD Debug Tools package. It is meant for
|
|
5
|
+
launching various tools within the package without installation.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
import sys
|
|
10
|
+
|
|
11
|
+
URL = "https://github.com/amd/amd-linux-debug-tools"
|
|
12
|
+
try:
|
|
13
|
+
import amd_debug
|
|
14
|
+
from amd_debug.common import fatal_error
|
|
15
|
+
except ModuleNotFoundError:
|
|
16
|
+
sys.exit(
|
|
17
|
+
f"\033[91m{sys.argv[0]} can not be run standalone.\n"
|
|
18
|
+
f"\033[0m\033[94mCheck out the full branch from {URL}\033[0m"
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def main():
|
|
23
|
+
"""Main function to launch the appropriate tool based on the script name."""
|
|
24
|
+
try:
|
|
25
|
+
return amd_debug.launch_tool(os.path.basename(sys.argv[0]))
|
|
26
|
+
except ModuleNotFoundError as e:
|
|
27
|
+
fatal_error(
|
|
28
|
+
f"Missing dependency: {e}\nRun ./install_deps.py to install dependencies."
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
if __name__ == "__main__":
|
|
33
|
+
sys.exit(main())
|
|
@@ -5,10 +5,10 @@ This module is a launcher for the AMD Debug Tools package. It is meant for
|
|
|
5
5
|
launching various tools within the package without installation.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
import sys
|
|
9
8
|
import os
|
|
9
|
+
import sys
|
|
10
10
|
|
|
11
|
-
URL = "
|
|
11
|
+
URL = "https://github.com/amd/amd-linux-debug-tools"
|
|
12
12
|
try:
|
|
13
13
|
import amd_debug
|
|
14
14
|
from amd_debug.common import fatal_error
|
|
@@ -25,8 +25,7 @@ def main():
|
|
|
25
25
|
return amd_debug.launch_tool(os.path.basename(sys.argv[0]))
|
|
26
26
|
except ModuleNotFoundError as e:
|
|
27
27
|
fatal_error(
|
|
28
|
-
f"Missing dependency: {e}\
|
|
29
|
-
f"Run ./install_deps.py to install dependencies."
|
|
28
|
+
f"Missing dependency: {e}\nRun ./install_deps.py to install dependencies."
|
|
30
29
|
)
|
|
31
30
|
|
|
32
31
|
|
|
@@ -5,10 +5,10 @@ This module is a launcher for the AMD Debug Tools package. It is meant for
|
|
|
5
5
|
launching various tools within the package without installation.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
import sys
|
|
9
8
|
import os
|
|
9
|
+
import sys
|
|
10
10
|
|
|
11
|
-
URL = "
|
|
11
|
+
URL = "https://github.com/amd/amd-linux-debug-tools"
|
|
12
12
|
try:
|
|
13
13
|
import amd_debug
|
|
14
14
|
from amd_debug.common import fatal_error
|
|
@@ -25,8 +25,7 @@ def main():
|
|
|
25
25
|
return amd_debug.launch_tool(os.path.basename(sys.argv[0]))
|
|
26
26
|
except ModuleNotFoundError as e:
|
|
27
27
|
fatal_error(
|
|
28
|
-
f"Missing dependency: {e}\
|
|
29
|
-
f"Run ./install_deps.py to install dependencies."
|
|
28
|
+
f"Missing dependency: {e}\nRun ./install_deps.py to install dependencies."
|
|
30
29
|
)
|
|
31
30
|
|
|
32
31
|
|
|
@@ -5,10 +5,10 @@ This module is a launcher for the AMD Debug Tools package. It is meant for
|
|
|
5
5
|
launching various tools within the package without installation.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
import sys
|
|
9
8
|
import os
|
|
9
|
+
import sys
|
|
10
10
|
|
|
11
|
-
URL = "
|
|
11
|
+
URL = "https://github.com/amd/amd-linux-debug-tools"
|
|
12
12
|
try:
|
|
13
13
|
import amd_debug
|
|
14
14
|
from amd_debug.common import fatal_error
|
|
@@ -25,8 +25,7 @@ def main():
|
|
|
25
25
|
return amd_debug.launch_tool(os.path.basename(sys.argv[0]))
|
|
26
26
|
except ModuleNotFoundError as e:
|
|
27
27
|
fatal_error(
|
|
28
|
-
f"Missing dependency: {e}\
|
|
29
|
-
f"Run ./install_deps.py to install dependencies."
|
|
28
|
+
f"Missing dependency: {e}\nRun ./install_deps.py to install dependencies."
|
|
30
29
|
)
|
|
31
30
|
|
|
32
31
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# BIOS log parser
|
|
2
|
+
`amd-bios` is a tool that can be used to enable or disable BIOS AML debug logging
|
|
3
|
+
and to parse a kernel log that contains BIOS logs.
|
|
4
|
+
|
|
5
|
+
Without any command, `amd-bios` starts the interactive Textual terminal
|
|
6
|
+
user interface (TUI) by default.
|
|
7
|
+
|
|
8
|
+
The following commands are supported.
|
|
9
|
+
|
|
10
|
+
## `amd-bios tui`
|
|
11
|
+
This will launch an interactive Textual terminal user interface (TUI) wrapping
|
|
12
|
+
the `trace` and `parse` commands.
|
|
13
|
+
This is also the default mode when `amd-bios` is invoked without any command.
|
|
14
|
+
|
|
15
|
+
The TUI presents a welcome screen to choose between managing BIOS AML tracing
|
|
16
|
+
and parsing a kernel log, and provides a tab for each. Tracing requires
|
|
17
|
+
root privileges; when the TUI is not running as root the trace command is
|
|
18
|
+
re-launched elevated (via `pkexec` or `sudo`) and its output is streamed back
|
|
19
|
+
into the TUI log.
|
|
20
|
+
|
|
21
|
+
The following optional arguments are supported for this command:
|
|
22
|
+
|
|
23
|
+
--tool-debug Enable tool debug logging
|
|
24
|
+
|
|
25
|
+
## `amd-bios trace`
|
|
26
|
+
Modify BIOS AML trace debug logging.
|
|
27
|
+
|
|
28
|
+
One of the following arguments must be set for this command:
|
|
29
|
+
|
|
30
|
+
--enable Enable BIOS AML tracing
|
|
31
|
+
--disable Disable BIOS AML tracing
|
|
32
|
+
|
|
33
|
+
The following optional arguments are supported for this command:
|
|
34
|
+
|
|
35
|
+
--tool-debug Enable tool debug logging
|
|
36
|
+
|
|
37
|
+
## `amd-bios parse`
|
|
38
|
+
Parses a kernel log that contains BIOS AML debug logging and produces a report.
|
|
39
|
+
|
|
40
|
+
The following optional arguments are supported for this command:
|
|
41
|
+
|
|
42
|
+
--input INPUT Optional input file to parse
|
|
43
|
+
--tool-debug Enable tool debug logging
|
|
44
|
+
|
|
45
|
+
## `amd-bios --version`
|
|
46
|
+
This will print the version of the tool and exit.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Per-rail power capture and plotting tool
|
|
2
|
+
`amd-power` records per-rail energy from IIO power monitor chips.
|
|
3
|
+
Data is saved into a SQLite database and the tool renders the result
|
|
4
|
+
as interactive plots. It has been validated with the Microchip PAC1954.
|
|
5
|
+
|
|
6
|
+
The tool reads the energy accumulator (`in_energyN_raw`, scaled by
|
|
7
|
+
`in_energyN_scale`; IIO scales yield milli-units, so joules = raw × scale / 1000) exposed under `/sys/bus/iio/devices/iio:deviceN`. Average
|
|
8
|
+
power for any interval is derived at query time as `ΔE/Δt`, which is the only
|
|
9
|
+
meaningful value for an accumulating sensor sampled at a finite cadence.
|
|
10
|
+
All of the sysfs files used are world-readable, so no root privileges are
|
|
11
|
+
needed.
|
|
12
|
+
|
|
13
|
+
The same discovery code is used by the [s2idle tool](amd-s2idle.md) to report
|
|
14
|
+
power consumed while suspended.
|
|
15
|
+
|
|
16
|
+
## Capturing
|
|
17
|
+
Run the capture loop in the foreground (default interval is 5 seconds):
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
❯ amd-power run --interval 5 --note "idle baseline"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
* `--db` selects the database. The default is `$AMD_POWER_DB` if set, otherwise
|
|
24
|
+
`$XDG_DATA_HOME/amd-debug-tools/power.db` (`~/.local/share/amd-debug-tools/power.db`).
|
|
25
|
+
* `--note` attaches free text to the capture run.
|
|
26
|
+
* `--log-level` sets the capture log level.
|
|
27
|
+
|
|
28
|
+
Stop it with Ctrl-C or SIGTERM; the run is closed cleanly.
|
|
29
|
+
|
|
30
|
+
## Running as a user service
|
|
31
|
+
`amd-power` manages its own user-level systemd unit. The capture options are
|
|
32
|
+
baked into the generated `ExecStart` line, so configure them at install time:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
❯ amd-power install --interval 5 --now
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Lifecycle commands:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
amd-power status
|
|
42
|
+
amd-power stop
|
|
43
|
+
amd-power start
|
|
44
|
+
amd-power restart
|
|
45
|
+
amd-power enable [--now]
|
|
46
|
+
amd-power disable [--now]
|
|
47
|
+
amd-power logs [-f] [-n LINES]
|
|
48
|
+
amd-power uninstall [--keep-unit]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`install --force` overwrites an existing unit; `install --exec PATH` selects
|
|
52
|
+
the `amd-power` executable (default: alongside the running Python).
|
|
53
|
+
To keep capturing without an active login, run once:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
sudo loginctl enable-linger "$USER"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Plotting
|
|
60
|
+
```
|
|
61
|
+
# Last 10 minutes of per-rail average power
|
|
62
|
+
❯ amd-power plot power.html
|
|
63
|
+
|
|
64
|
+
# Last 2 hours, CPU and GPU rails only, several metrics stacked
|
|
65
|
+
❯ amd-power plot cpu_gpu.html --since 2h --rails 'CPU_*' --rails 'GPU_*' \
|
|
66
|
+
--metric power --metric energy --metric aggregate \
|
|
67
|
+
--resample 30s --energy-unit Wh
|
|
68
|
+
|
|
69
|
+
# Explicit ISO timestamps (naive timestamps are UTC)
|
|
70
|
+
❯ amd-power plot window.html --since 2026-05-20T08:00 --until 2026-05-20T09:00
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`--since` and `--until` accept either a duration relative to the window end
|
|
74
|
+
(`30s`, `10m`, `2h`, `1d`) or an ISO-8601 timestamp.
|
|
75
|
+
|
|
76
|
+
Available metrics:
|
|
77
|
+
|
|
78
|
+
| Metric | Description |
|
|
79
|
+
|-------------|----------------------------------------------------|
|
|
80
|
+
| `power` | Average power per rail (ΔE/Δt) |
|
|
81
|
+
| `energy` | Cumulative energy per rail (`Wh` or `J`) |
|
|
82
|
+
| `aggregate` | Total system power plus per-chip subtotals |
|
|
83
|
+
|
|
84
|
+
Gaps longer than ten times the median sample interval (for example while the
|
|
85
|
+
capture service was stopped) reset the energy delta, so traces don't jump
|
|
86
|
+
across restarts.
|
|
87
|
+
|
|
88
|
+
## Database schema
|
|
89
|
+
* `rails(id, device, channel, label, energy_scale)`
|
|
90
|
+
* `samples(rail_id, ts, energy_raw)` with primary key `(rail_id, ts)`
|
|
91
|
+
* `capture_runs(id, started_ts, ended_ts, note)`
|
|
92
|
+
|
|
93
|
+
Raw accumulator values are stored as read; the scale is applied at query time.
|
|
@@ -10,7 +10,36 @@ For analysis of power consumption issues it can be hooked into `systemd` to
|
|
|
10
10
|
run a command to capture data right before and after the system enters and
|
|
11
11
|
exits the s2idle state.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
The tool supports both AMD and Intel platforms. The prerequisites that are
|
|
14
|
+
checked are selected based on the CPU vendor, so that only the checks that
|
|
15
|
+
are meaningful for the platform are run. See
|
|
16
|
+
[platform support](platform-support.md) for the details of what is checked
|
|
17
|
+
on each platform.
|
|
18
|
+
|
|
19
|
+
Without any command, `amd-s2idle` starts the interactive Textual terminal
|
|
20
|
+
user interface (TUI) by default.
|
|
21
|
+
|
|
22
|
+
The following commands are supported.
|
|
23
|
+
|
|
24
|
+
## `amd-s2idle tui`
|
|
25
|
+
This will launch an interactive Textual terminal user interface (TUI) wrapping
|
|
26
|
+
the `test`, `report`, `triage`, `install`, and `uninstall` commands.
|
|
27
|
+
This is also the default mode when `amd-s2idle` is invoked without any command.
|
|
28
|
+
|
|
29
|
+
The following optional arguments are supported for this command:
|
|
30
|
+
|
|
31
|
+
--tool-debug Enable debug logging
|
|
32
|
+
|
|
33
|
+
## `amd-s2idle triage`
|
|
34
|
+
This will interactively triage s2idle hangs by guiding the user through
|
|
35
|
+
an interview and diagnostic steps across reboots.
|
|
36
|
+
|
|
37
|
+
The following optional arguments are supported for this command:
|
|
38
|
+
|
|
39
|
+
--restart Abandon any triage in progress and start over
|
|
40
|
+
--format FORMAT Format of the report to produce (html, txt or md)
|
|
41
|
+
--report-file File to write the report to
|
|
42
|
+
--tool-debug Enable debug logging
|
|
14
43
|
|
|
15
44
|
## `amd-s2idle install`
|
|
16
45
|
This will install the systemd hook so that data will be captured before and
|
|
@@ -56,7 +85,7 @@ The following optional arguments are supported for this command:
|
|
|
56
85
|
--until UNTIL Date to end the report at
|
|
57
86
|
--format FORMAT Format of the report to produce (html, txt or md)
|
|
58
87
|
--report-file File to write the report to
|
|
59
|
-
--tool-debug Enable
|
|
88
|
+
--tool-debug Enable debug logging
|
|
60
89
|
--report-debug
|
|
61
90
|
--no-report-debug
|
|
62
91
|
Include debug messages in report (WARNING: can significantly increase report size)
|
|
@@ -70,4 +99,4 @@ This will print the version of the tool and exit.
|
|
|
70
99
|
All commands support the `--tool-debug` argument which will enable extra debug output. This is often needed for debugging issues with a particular cycle.
|
|
71
100
|
|
|
72
101
|
**NOTE:** enabling debug output significantly increases the size of the report.
|
|
73
|
-
It's suggested that you use `--since` and `--until` to focus on the cycles that you are interested in.
|
|
102
|
+
It's suggested that you use `--since` and `--until` to focus on the cycles that you are interested in.
|