Skip JIT LTO example when PTX cannot load#2151
Open
kiwigitops wants to merge 1 commit into
Open
Conversation
Contributor
leofang
requested changes
May 29, 2026
Comment on lines
+51
to
+54
| def can_load_generated_ptx() -> bool: | ||
| from cuda.core._program import _can_load_generated_ptx | ||
|
|
||
| return _can_load_generated_ptx() |
Member
There was a problem hiding this comment.
No need to wrap it. Just move the import to the top.
| SYSTEM_REQUIREMENTS = { | ||
| "memory_pool_resources.py": has_recent_memory_pool_support, | ||
| "gl_interop_plasma.py": has_display, | ||
| "jit_lto_fractal.py": can_load_generated_ptx, |
Member
There was a problem hiding this comment.
... and use it here directly:
Suggested change
| "jit_lto_fractal.py": can_load_generated_ptx, | |
| "jit_lto_fractal.py": _can_load_generated_ptx, |
Comment on lines
+103
to
+107
| def test_jit_lto_fractal_requires_loadable_ptx(monkeypatch): | ||
| from cuda.core import _program | ||
|
|
||
| monkeypatch.setattr(_program, "_can_load_generated_ptx", lambda: False) | ||
| assert not SYSTEM_REQUIREMENTS["jit_lto_fractal.py"]() |
Member
There was a problem hiding this comment.
Please do not add tests for tests.
Signed-off-by: kiwigitops <kiwisclubco@gmail.com>
3ce6be8 to
dd10891
Compare
Author
|
Updated, thanks. I moved Checks:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1851.
The
jit_lto_fractal.pyexample compiles PTX before it runs the rest of the example. When the generated PTX is newer than the active driver can load, the broader test suite already treats that condition as a skip, but the example subprocess kept running and could fail with the Windows access-violation exit seen in the issue.This adds
jit_lto_fractal.pyto the example system requirements using the existing_can_load_generated_ptx()helper, so the example is skipped under the same driver/backend mismatch instead of launching the subprocess.Tested:
python -m compileall -q cuda_core/tests/example_tests/test_basic_examples.pypython -m ruff check cuda_core/tests/example_tests/test_basic_examples.pygit diff --check