gpu-stack-inspector 0.1.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.
- gpu_stack_inspector-0.1.0/LICENSE +21 -0
- gpu_stack_inspector-0.1.0/PKG-INFO +134 -0
- gpu_stack_inspector-0.1.0/README.md +100 -0
- gpu_stack_inspector-0.1.0/pyproject.toml +133 -0
- gpu_stack_inspector-0.1.0/pyproject.toml.orig +110 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/__init__.py +8 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/__main__.py +6 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/cli.py +335 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/collectors/__init__.py +1 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/collectors/environment.py +31 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/collectors/host.py +48 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/collectors/nvidia.py +166 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/collectors/python_env.py +63 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/collectors/toolkit.py +160 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/compatibility/__init__.py +1 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/compatibility/data.json +24 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/compatibility/loader.py +75 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/compatibility/versions.py +25 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/exit_codes.py +22 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/models.py +349 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/orchestrator.py +132 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/privacy.py +237 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/probes/__init__.py +1 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/probes/metadata_probe.py +230 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/probes/metadata_program.py +232 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/probes/runtime_probe.py +153 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/probes/runtime_program.py +101 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/reports/__init__.py +1 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/reports/json_report.py +43 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/reports/markdown.py +182 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/reports/terminal.py +298 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/rules/__init__.py +1 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/rules/catalog.py +21 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/rules/comparison.py +73 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/rules/compatibility.py +256 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/rules/differences.py +64 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/rules/engine.py +101 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/rules/host.py +259 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/rules/interpreters.py +422 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/rules/torch_build.py +227 -0
- gpu_stack_inspector-0.1.0/src/gpu_stack_inspector/runner.py +273 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BhuwanJoshi-01
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gpu-stack-inspector
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Explain why your AI code uses the GPU in one Python environment but not another.
|
|
5
|
+
Keywords: cuda,pytorch,gpu,nvidia,conda,venv,diagnostics,troubleshooting
|
|
6
|
+
Author: BhuwanJoshi-01
|
|
7
|
+
Author-email: BhuwanJoshi-01 <bhuwanj779@gmail.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Classifier: Topic :: System :: Hardware
|
|
23
|
+
Classifier: Topic :: Utilities
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Dist: rich>=15.0.0
|
|
26
|
+
Requires-Dist: typer>=0.27.3
|
|
27
|
+
Requires-Python: >=3.11
|
|
28
|
+
Project-URL: Homepage, https://bhuwanjoshi-01.github.io/gpu-stack-inspector/
|
|
29
|
+
Project-URL: Documentation, https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/troubleshooting.md
|
|
30
|
+
Project-URL: Source, https://github.com/BhuwanJoshi-01/gpu-stack-inspector
|
|
31
|
+
Project-URL: Issues, https://github.com/BhuwanJoshi-01/gpu-stack-inspector/issues
|
|
32
|
+
Project-URL: Changelog, https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/CHANGELOG.md
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# GPU Stack Inspector
|
|
36
|
+
|
|
37
|
+
**Explain why your AI code uses the GPU in one Python environment but not another.**
|
|
38
|
+
|
|
39
|
+
[](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/actions/workflows/ci.yml)
|
|
40
|
+
[](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/LICENSE)
|
|
41
|
+
[](https://bhuwanjoshi-01.github.io/gpu-stack-inspector/)
|
|
42
|
+
|
|
43
|
+
`nvidia-smi` shows your GPU, yet `torch.cuda.is_available()` is `True` in one environment and `False` in another.
|
|
44
|
+
GPU Stack Inspector inspects several Python interpreters from one command, shows what differs between them, and
|
|
45
|
+
explains which difference matters, with the evidence:
|
|
46
|
+
|
|
47
|
+

|
|
48
|
+
|
|
49
|
+
> **Status:** 0.1.0 is the first release, validated on one laptop with five real environments. Reports from
|
|
50
|
+
> other machines are very welcome.
|
|
51
|
+
|
|
52
|
+
## Install
|
|
53
|
+
|
|
54
|
+
The tool needs Python 3.11 or newer; the interpreters it inspects can be Python 3.8 or newer.
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
uv tool install git+https://github.com/BhuwanJoshi-01/gpu-stack-inspector # until the PyPI release
|
|
58
|
+
pipx install git+https://github.com/BhuwanJoshi-01/gpu-stack-inspector # or with pipx
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Use
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
gpu-stack-inspector compare --python ~/envs/works/bin/python --python ~/envs/broken/bin/python
|
|
65
|
+
gpu-stack-inspector inspect --python ~/envs/broken/bin/python # one environment in detail
|
|
66
|
+
gpu-stack-inspector probe --runtime --python ~/envs/broken/bin/python # opt-in: really runs a tiny CUDA operation
|
|
67
|
+
gpu-stack-inspector report --python ~/envs/broken/bin/python --output gpu-report.md # redacted, for an issue
|
|
68
|
+
gpu-stack-inspector rules list # every check; `rules explain CODE` for one
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Without `--python` it inspects the `python` your shell runs. See the [command reference](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/cli.md).
|
|
72
|
+
|
|
73
|
+
## What it checks
|
|
74
|
+
|
|
75
|
+
- **The machine**: driver tools, whether the driver answers and which CUDA versions it supports, the GPUs and their
|
|
76
|
+
compute capability, `CUDA_VISIBLE_DEVICES`.
|
|
77
|
+
- **Each interpreter**: whether it starts, whether it is the one your shell runs, whether torch is installed where it
|
|
78
|
+
is needed, and which build it is (CUDA with its version, CPU-only, ROCm), decided from the version tag,
|
|
79
|
+
`torch/version.py`, the CUDA libraries in `torch/lib`, the `nvidia-*` requirements and conda's records, without
|
|
80
|
+
importing torch.
|
|
81
|
+
- **Compatibility**: the driver against the CUDA version torch was built for and against nvcc, using dated,
|
|
82
|
+
source-tagged NVIDIA compatibility data.
|
|
83
|
+
- **The comparison**: every field that differs, and whether the environments have different PyTorch builds.
|
|
84
|
+
- **At runtime** (`probe --runtime` only): importing torch and running an operation on the GPU, step by step.
|
|
85
|
+
|
|
86
|
+
Every finding has a stable code, the evidence it rests on, what to do next and the command to check it afterwards.
|
|
87
|
+
[Troubleshooting](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/troubleshooting.md) explains the common ones.
|
|
88
|
+
|
|
89
|
+
## What it promises
|
|
90
|
+
|
|
91
|
+
- **Read-only.** It never installs, upgrades or changes anything, and never needs `sudo`. It writes nothing except a
|
|
92
|
+
report file you name.
|
|
93
|
+
- **Your environments stay untouched.** A fixed probe program reads each interpreter's metadata. torch is only
|
|
94
|
+
imported with `probe --runtime`, because creating a CUDA context uses GPU memory and can hang on a broken system.
|
|
95
|
+
- **Unknown is not a pass.** A check that could not run is unknown or not tested, never green.
|
|
96
|
+
- **Shareable output.** Home paths, user and host names, secrets and tokens are redacted before anything is printed
|
|
97
|
+
or written, JSON included, and each report says what was redacted. No network access, no telemetry.
|
|
98
|
+
|
|
99
|
+
Details in [privacy](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/privacy.md).
|
|
100
|
+
|
|
101
|
+
## Tested on
|
|
102
|
+
|
|
103
|
+
An Ubuntu 26.04 laptop with an RTX 3050 (driver 595.99.02) and five real environments: conda and uv, Python 3.8 to
|
|
104
|
+
3.13, CUDA 11.3 to 13.0 builds and a CPU-only build. CI runs the tests on Linux and Windows and the probe in Python
|
|
105
|
+
3.8 to 3.10 and PyPy. Windows and WSL with a GPU, containers and macOS are **not validated**; see the
|
|
106
|
+
[support matrix](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/support-matrix.md).
|
|
107
|
+
|
|
108
|
+
## Alternatives
|
|
109
|
+
|
|
110
|
+
If you only need to check a single environment, these may already be enough:
|
|
111
|
+
|
|
112
|
+
- [cuda-doctor](https://pypi.org/project/cuda-doctor/) checks the GPU, driver, toolkit, compiler and PyTorch of the
|
|
113
|
+
environment it is installed in.
|
|
114
|
+
- [env-doctor](https://github.com/mitulgarg/env-doctor) checks the driver, CUDA, cuDNN and frameworks, and compares
|
|
115
|
+
machines in a fleet dashboard.
|
|
116
|
+
- [cudadoc](https://www.cudadoc.com/docs/quickstart) includes a GPU validation suite.
|
|
117
|
+
|
|
118
|
+
GPU Stack Inspector focuses on comparing **environments on the same machine**.
|
|
119
|
+
|
|
120
|
+
## Documentation
|
|
121
|
+
|
|
122
|
+
[Command reference](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/cli.md) · [Troubleshooting](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/troubleshooting.md) · [Privacy](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/privacy.md) ·
|
|
123
|
+
[Support matrix](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/support-matrix.md) · [JSON output](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/json-output.md) · [Architecture](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/architecture.md) ·
|
|
124
|
+
[Sample reports](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/tree/main/docs/sample-reports) · [Roadmap](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/roadmap.md)
|
|
125
|
+
|
|
126
|
+
## Contributing
|
|
127
|
+
|
|
128
|
+
Test reports, fixtures from unusual systems, bug reports and pull requests are welcome; see
|
|
129
|
+
[CONTRIBUTING.md](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/CONTRIBUTING.md). Security problems, including a report that leaks private data, go through
|
|
130
|
+
[SECURITY.md](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/SECURITY.md).
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
[MIT](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/LICENSE)
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# GPU Stack Inspector
|
|
2
|
+
|
|
3
|
+
**Explain why your AI code uses the GPU in one Python environment but not another.**
|
|
4
|
+
|
|
5
|
+
[](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/actions/workflows/ci.yml)
|
|
6
|
+
[](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/LICENSE)
|
|
7
|
+
[](https://bhuwanjoshi-01.github.io/gpu-stack-inspector/)
|
|
8
|
+
|
|
9
|
+
`nvidia-smi` shows your GPU, yet `torch.cuda.is_available()` is `True` in one environment and `False` in another.
|
|
10
|
+
GPU Stack Inspector inspects several Python interpreters from one command, shows what differs between them, and
|
|
11
|
+
explains which difference matters, with the evidence:
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
> **Status:** 0.1.0 is the first release, validated on one laptop with five real environments. Reports from
|
|
16
|
+
> other machines are very welcome.
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
The tool needs Python 3.11 or newer; the interpreters it inspects can be Python 3.8 or newer.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
uv tool install git+https://github.com/BhuwanJoshi-01/gpu-stack-inspector # until the PyPI release
|
|
24
|
+
pipx install git+https://github.com/BhuwanJoshi-01/gpu-stack-inspector # or with pipx
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Use
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
gpu-stack-inspector compare --python ~/envs/works/bin/python --python ~/envs/broken/bin/python
|
|
31
|
+
gpu-stack-inspector inspect --python ~/envs/broken/bin/python # one environment in detail
|
|
32
|
+
gpu-stack-inspector probe --runtime --python ~/envs/broken/bin/python # opt-in: really runs a tiny CUDA operation
|
|
33
|
+
gpu-stack-inspector report --python ~/envs/broken/bin/python --output gpu-report.md # redacted, for an issue
|
|
34
|
+
gpu-stack-inspector rules list # every check; `rules explain CODE` for one
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Without `--python` it inspects the `python` your shell runs. See the [command reference](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/cli.md).
|
|
38
|
+
|
|
39
|
+
## What it checks
|
|
40
|
+
|
|
41
|
+
- **The machine**: driver tools, whether the driver answers and which CUDA versions it supports, the GPUs and their
|
|
42
|
+
compute capability, `CUDA_VISIBLE_DEVICES`.
|
|
43
|
+
- **Each interpreter**: whether it starts, whether it is the one your shell runs, whether torch is installed where it
|
|
44
|
+
is needed, and which build it is (CUDA with its version, CPU-only, ROCm), decided from the version tag,
|
|
45
|
+
`torch/version.py`, the CUDA libraries in `torch/lib`, the `nvidia-*` requirements and conda's records, without
|
|
46
|
+
importing torch.
|
|
47
|
+
- **Compatibility**: the driver against the CUDA version torch was built for and against nvcc, using dated,
|
|
48
|
+
source-tagged NVIDIA compatibility data.
|
|
49
|
+
- **The comparison**: every field that differs, and whether the environments have different PyTorch builds.
|
|
50
|
+
- **At runtime** (`probe --runtime` only): importing torch and running an operation on the GPU, step by step.
|
|
51
|
+
|
|
52
|
+
Every finding has a stable code, the evidence it rests on, what to do next and the command to check it afterwards.
|
|
53
|
+
[Troubleshooting](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/troubleshooting.md) explains the common ones.
|
|
54
|
+
|
|
55
|
+
## What it promises
|
|
56
|
+
|
|
57
|
+
- **Read-only.** It never installs, upgrades or changes anything, and never needs `sudo`. It writes nothing except a
|
|
58
|
+
report file you name.
|
|
59
|
+
- **Your environments stay untouched.** A fixed probe program reads each interpreter's metadata. torch is only
|
|
60
|
+
imported with `probe --runtime`, because creating a CUDA context uses GPU memory and can hang on a broken system.
|
|
61
|
+
- **Unknown is not a pass.** A check that could not run is unknown or not tested, never green.
|
|
62
|
+
- **Shareable output.** Home paths, user and host names, secrets and tokens are redacted before anything is printed
|
|
63
|
+
or written, JSON included, and each report says what was redacted. No network access, no telemetry.
|
|
64
|
+
|
|
65
|
+
Details in [privacy](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/privacy.md).
|
|
66
|
+
|
|
67
|
+
## Tested on
|
|
68
|
+
|
|
69
|
+
An Ubuntu 26.04 laptop with an RTX 3050 (driver 595.99.02) and five real environments: conda and uv, Python 3.8 to
|
|
70
|
+
3.13, CUDA 11.3 to 13.0 builds and a CPU-only build. CI runs the tests on Linux and Windows and the probe in Python
|
|
71
|
+
3.8 to 3.10 and PyPy. Windows and WSL with a GPU, containers and macOS are **not validated**; see the
|
|
72
|
+
[support matrix](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/support-matrix.md).
|
|
73
|
+
|
|
74
|
+
## Alternatives
|
|
75
|
+
|
|
76
|
+
If you only need to check a single environment, these may already be enough:
|
|
77
|
+
|
|
78
|
+
- [cuda-doctor](https://pypi.org/project/cuda-doctor/) checks the GPU, driver, toolkit, compiler and PyTorch of the
|
|
79
|
+
environment it is installed in.
|
|
80
|
+
- [env-doctor](https://github.com/mitulgarg/env-doctor) checks the driver, CUDA, cuDNN and frameworks, and compares
|
|
81
|
+
machines in a fleet dashboard.
|
|
82
|
+
- [cudadoc](https://www.cudadoc.com/docs/quickstart) includes a GPU validation suite.
|
|
83
|
+
|
|
84
|
+
GPU Stack Inspector focuses on comparing **environments on the same machine**.
|
|
85
|
+
|
|
86
|
+
## Documentation
|
|
87
|
+
|
|
88
|
+
[Command reference](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/cli.md) · [Troubleshooting](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/troubleshooting.md) · [Privacy](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/privacy.md) ·
|
|
89
|
+
[Support matrix](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/support-matrix.md) · [JSON output](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/json-output.md) · [Architecture](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/architecture.md) ·
|
|
90
|
+
[Sample reports](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/tree/main/docs/sample-reports) · [Roadmap](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/roadmap.md)
|
|
91
|
+
|
|
92
|
+
## Contributing
|
|
93
|
+
|
|
94
|
+
Test reports, fixtures from unusual systems, bug reports and pull requests are welcome; see
|
|
95
|
+
[CONTRIBUTING.md](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/CONTRIBUTING.md). Security problems, including a report that leaks private data, go through
|
|
96
|
+
[SECURITY.md](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/SECURITY.md).
|
|
97
|
+
|
|
98
|
+
## License
|
|
99
|
+
|
|
100
|
+
[MIT](https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/LICENSE)
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "gpu-stack-inspector"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Explain why your AI code uses the GPU in one Python environment but not another."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
requires-python = ">=3.11"
|
|
9
|
+
keywords = [
|
|
10
|
+
"cuda",
|
|
11
|
+
"pytorch",
|
|
12
|
+
"gpu",
|
|
13
|
+
"nvidia",
|
|
14
|
+
"conda",
|
|
15
|
+
"venv",
|
|
16
|
+
"diagnostics",
|
|
17
|
+
"troubleshooting",
|
|
18
|
+
]
|
|
19
|
+
classifiers = [
|
|
20
|
+
"Development Status :: 4 - Beta",
|
|
21
|
+
"Environment :: Console",
|
|
22
|
+
"Intended Audience :: Developers",
|
|
23
|
+
"Intended Audience :: Science/Research",
|
|
24
|
+
"Operating System :: POSIX :: Linux",
|
|
25
|
+
"Operating System :: Microsoft :: Windows",
|
|
26
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
27
|
+
"Programming Language :: Python :: 3.11",
|
|
28
|
+
"Programming Language :: Python :: 3.12",
|
|
29
|
+
"Programming Language :: Python :: 3.13",
|
|
30
|
+
"Programming Language :: Python :: 3.14",
|
|
31
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
32
|
+
"Topic :: System :: Hardware",
|
|
33
|
+
"Topic :: Utilities",
|
|
34
|
+
"Typing :: Typed",
|
|
35
|
+
]
|
|
36
|
+
dependencies = [
|
|
37
|
+
"rich>=15.0.0",
|
|
38
|
+
"typer>=0.27.3",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[[project.authors]]
|
|
42
|
+
name = "BhuwanJoshi-01"
|
|
43
|
+
email = "bhuwanj779@gmail.com"
|
|
44
|
+
|
|
45
|
+
[project.urls]
|
|
46
|
+
Homepage = "https://bhuwanjoshi-01.github.io/gpu-stack-inspector/"
|
|
47
|
+
Documentation = "https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/troubleshooting.md"
|
|
48
|
+
Source = "https://github.com/BhuwanJoshi-01/gpu-stack-inspector"
|
|
49
|
+
Issues = "https://github.com/BhuwanJoshi-01/gpu-stack-inspector/issues"
|
|
50
|
+
Changelog = "https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/CHANGELOG.md"
|
|
51
|
+
|
|
52
|
+
[project.scripts]
|
|
53
|
+
gpu-stack-inspector = "gpu_stack_inspector.cli:main"
|
|
54
|
+
|
|
55
|
+
[build-system]
|
|
56
|
+
requires = ["uv_build>=0.11.29,<0.12.0"]
|
|
57
|
+
build-backend = "uv_build"
|
|
58
|
+
|
|
59
|
+
[dependency-groups]
|
|
60
|
+
dev = [
|
|
61
|
+
"hypothesis>=6.170.14",
|
|
62
|
+
"jsonschema>=4.26.0",
|
|
63
|
+
"mypy>=2.4.1",
|
|
64
|
+
"pytest>=9.2.0",
|
|
65
|
+
"pytest-cov>=7.1.0",
|
|
66
|
+
"ruff>=0.17.3",
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
[tool.ruff]
|
|
70
|
+
line-length = 100
|
|
71
|
+
target-version = "py311"
|
|
72
|
+
src = [
|
|
73
|
+
"src",
|
|
74
|
+
"tests",
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
[tool.ruff.lint]
|
|
78
|
+
select = [
|
|
79
|
+
"E",
|
|
80
|
+
"W",
|
|
81
|
+
"F",
|
|
82
|
+
"I",
|
|
83
|
+
"B",
|
|
84
|
+
"UP",
|
|
85
|
+
"SIM",
|
|
86
|
+
"C4",
|
|
87
|
+
"PTH",
|
|
88
|
+
"S",
|
|
89
|
+
"PT",
|
|
90
|
+
"RUF",
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
[tool.ruff.lint.isort]
|
|
94
|
+
known-first-party = [
|
|
95
|
+
"gpu_stack_inspector",
|
|
96
|
+
"tests",
|
|
97
|
+
]
|
|
98
|
+
|
|
99
|
+
[tool.ruff.lint.per-file-ignores]
|
|
100
|
+
"src/gpu_stack_inspector/probes/*_program.py" = [
|
|
101
|
+
"UP",
|
|
102
|
+
"PTH",
|
|
103
|
+
]
|
|
104
|
+
"tests/**" = [
|
|
105
|
+
"S101",
|
|
106
|
+
"S105",
|
|
107
|
+
"S106",
|
|
108
|
+
]
|
|
109
|
+
|
|
110
|
+
[tool.mypy]
|
|
111
|
+
python_version = "3.11"
|
|
112
|
+
strict = true
|
|
113
|
+
warn_unreachable = true
|
|
114
|
+
files = ["src"]
|
|
115
|
+
|
|
116
|
+
[tool.pytest.ini_options]
|
|
117
|
+
testpaths = ["tests"]
|
|
118
|
+
pythonpath = ["."]
|
|
119
|
+
addopts = [
|
|
120
|
+
"-ra",
|
|
121
|
+
"--strict-markers",
|
|
122
|
+
"--strict-config",
|
|
123
|
+
]
|
|
124
|
+
xfail_strict = true
|
|
125
|
+
markers = ["integration: talks to the real machine; runs only with GSI_INTEGRATION=1"]
|
|
126
|
+
|
|
127
|
+
[tool.coverage.run]
|
|
128
|
+
source = ["gpu_stack_inspector"]
|
|
129
|
+
branch = true
|
|
130
|
+
|
|
131
|
+
[tool.coverage.report]
|
|
132
|
+
show_missing = true
|
|
133
|
+
skip_covered = true
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "gpu-stack-inspector"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Explain why your AI code uses the GPU in one Python environment but not another."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "BhuwanJoshi-01", email = "bhuwanj779@gmail.com" }
|
|
10
|
+
]
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
keywords = ["cuda", "pytorch", "gpu", "nvidia", "conda", "venv", "diagnostics", "troubleshooting"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 4 - Beta",
|
|
15
|
+
"Environment :: Console",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"Intended Audience :: Science/Research",
|
|
18
|
+
"Operating System :: POSIX :: Linux",
|
|
19
|
+
"Operating System :: Microsoft :: Windows",
|
|
20
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Programming Language :: Python :: 3.14",
|
|
25
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
26
|
+
"Topic :: System :: Hardware",
|
|
27
|
+
"Topic :: Utilities",
|
|
28
|
+
"Typing :: Typed",
|
|
29
|
+
]
|
|
30
|
+
dependencies = [
|
|
31
|
+
"rich>=15.0.0",
|
|
32
|
+
"typer>=0.27.3",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Homepage = "https://bhuwanjoshi-01.github.io/gpu-stack-inspector/"
|
|
37
|
+
Documentation = "https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/docs/troubleshooting.md"
|
|
38
|
+
Source = "https://github.com/BhuwanJoshi-01/gpu-stack-inspector"
|
|
39
|
+
Issues = "https://github.com/BhuwanJoshi-01/gpu-stack-inspector/issues"
|
|
40
|
+
Changelog = "https://github.com/BhuwanJoshi-01/gpu-stack-inspector/blob/main/CHANGELOG.md"
|
|
41
|
+
|
|
42
|
+
[project.scripts]
|
|
43
|
+
gpu-stack-inspector = "gpu_stack_inspector.cli:main"
|
|
44
|
+
|
|
45
|
+
[build-system]
|
|
46
|
+
requires = ["uv_build>=0.11.29,<0.12.0"]
|
|
47
|
+
build-backend = "uv_build"
|
|
48
|
+
|
|
49
|
+
[dependency-groups]
|
|
50
|
+
dev = [
|
|
51
|
+
"hypothesis>=6.170.14",
|
|
52
|
+
"jsonschema>=4.26.0",
|
|
53
|
+
"mypy>=2.4.1",
|
|
54
|
+
"pytest>=9.2.0",
|
|
55
|
+
"pytest-cov>=7.1.0",
|
|
56
|
+
"ruff>=0.17.3",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[tool.ruff]
|
|
60
|
+
line-length = 100
|
|
61
|
+
target-version = "py311"
|
|
62
|
+
src = ["src", "tests"]
|
|
63
|
+
|
|
64
|
+
[tool.ruff.lint]
|
|
65
|
+
select = [
|
|
66
|
+
"E", "W", "F", # pycodestyle, pyflakes
|
|
67
|
+
"I", # import order
|
|
68
|
+
"B", # bugbear
|
|
69
|
+
"UP", # pyupgrade
|
|
70
|
+
"SIM", # simplify
|
|
71
|
+
"C4", # comprehensions
|
|
72
|
+
"PTH", # pathlib
|
|
73
|
+
"S", # bandit: subprocess and secret handling matter in this tool
|
|
74
|
+
"PT", # pytest style
|
|
75
|
+
"RUF",
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
[tool.ruff.lint.isort]
|
|
79
|
+
known-first-party = ["gpu_stack_inspector", "tests"]
|
|
80
|
+
|
|
81
|
+
[tool.ruff.lint.per-file-ignores]
|
|
82
|
+
# Runs inside target interpreters as old as Python 3.8: no modern syntax upgrades.
|
|
83
|
+
"src/gpu_stack_inspector/probes/*_program.py" = ["UP", "PTH"]
|
|
84
|
+
"tests/**" = [
|
|
85
|
+
"S101", # assert is how pytest works
|
|
86
|
+
"S105", "S106", # fake secrets are the point of the redaction tests
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
[tool.mypy]
|
|
90
|
+
python_version = "3.11"
|
|
91
|
+
strict = true
|
|
92
|
+
warn_unreachable = true
|
|
93
|
+
files = ["src"]
|
|
94
|
+
|
|
95
|
+
[tool.pytest.ini_options]
|
|
96
|
+
testpaths = ["tests"]
|
|
97
|
+
pythonpath = ["."]
|
|
98
|
+
addopts = ["-ra", "--strict-markers", "--strict-config"]
|
|
99
|
+
xfail_strict = true
|
|
100
|
+
markers = [
|
|
101
|
+
"integration: talks to the real machine; runs only with GSI_INTEGRATION=1",
|
|
102
|
+
]
|
|
103
|
+
|
|
104
|
+
[tool.coverage.run]
|
|
105
|
+
source = ["gpu_stack_inspector"]
|
|
106
|
+
branch = true
|
|
107
|
+
|
|
108
|
+
[tool.coverage.report]
|
|
109
|
+
show_missing = true
|
|
110
|
+
skip_covered = true
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"""GPU Stack Inspector: explain GPU differences between Python environments."""
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
__version__ = version("gpu-stack-inspector")
|
|
7
|
+
except PackageNotFoundError: # imported from a source tree that was never installed
|
|
8
|
+
__version__ = "0+unknown"
|