Skip to content

Conversation

@cpcloud
Copy link
Contributor

@cpcloud cpcloud commented Dec 1, 2025

Factor out repetitive cuda setup in cuda_bindings into pytest fixtures.

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Dec 1, 2025

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@cpcloud
Copy link
Contributor Author

cpcloud commented Dec 1, 2025

/ok to test

@cpcloud cpcloud requested a review from leofang December 1, 2025 16:59
@github-actions

This comment has been minimized.

@cpcloud cpcloud requested a review from kkraus14 December 1, 2025 17:41
@cpcloud cpcloud force-pushed the cuda-bindings-fixtures branch from 54dc267 to ca10214 Compare December 2, 2025 16:49
@cpcloud
Copy link
Contributor Author

cpcloud commented Dec 2, 2025

/ok to test

@cpcloud cpcloud enabled auto-merge (squash) December 2, 2025 17:20
@cpcloud cpcloud merged commit a49af74 into NVIDIA:main Dec 2, 2025
61 checks passed

@pytest.fixture(scope="module")
def cuda_driver():
(err,) = cuda.cuInit(0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW cuInit cannot be undone once it's called. Might as well make it scope='session'.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I will put up a follow-up for that in a bit.

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

Doc Preview CI
Preview removed because the pull request was closed or merged.

@cpcloud cpcloud deleted the cuda-bindings-fixtures branch December 2, 2025 17:51
@leofang
Copy link
Member

leofang commented Dec 2, 2025

LGTM too! Thanks, Phillip!

@leofang leofang added enhancement Any code-related improvements P1 Medium priority - Should do test Improvements or additions to tests cuda.bindings Everything related to the cuda.bindings module labels Dec 2, 2025
@leofang leofang added this to the cuda-python 13-next, 12-next milestone Dec 2, 2025
@cpcloud
Copy link
Contributor Author

cpcloud commented Dec 2, 2025

This should help us be more confident about pytest-randomly usage inside cuda-bindings. I will look into factoring out fixtures where possible in cuda-core as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.bindings Everything related to the cuda.bindings module enhancement Any code-related improvements P1 Medium priority - Should do test Improvements or additions to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants