Skip to content

Pass correct object to getCudaAccessPolicyWindow#48

Open
bleenhou wants to merge 1 commit into
jcuda:masterfrom
bleenhou:master
Open

Pass correct object to getCudaAccessPolicyWindow#48
bleenhou wants to merge 1 commit into
jcuda:masterfrom
bleenhou:master

Conversation

@bleenhou

@bleenhou bleenhou commented Apr 7, 2026

Copy link
Copy Markdown

Fixes Wrong field ID passed to JNI when calling JCudaDriver.cuStreamSetAttribute with CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW

…ID passed to JNI when calling JCudaDriver.cuStreamSetAttribute with CU_STREAM_ATTRIBUTE_ACCESS_POLICY_WINDOW
@jcuda

jcuda commented Apr 16, 2026

Copy link
Copy Markdown
Owner

Fixes #47

Thanks for the issue report and the PR.

From just looking over the code, I suspect that the javaObject in https://github.com/bleenhou/jcuda/blob/a6908ccb637e025e8dcec629cc13961d1e02ff05/JCudaDriverJNI/src/JCudaDriver.cpp#L2199 should also be the javaWindow. If you (can confirm this, and/or) want to change that as well, I'll wait before merging. Otherwise, I'll just try to run some local test based on the snippet that you provided in the issue, and merge it after that.

BTW: The whole "graph/node" API is certainly not tested extensively, and there are no guarantees that any of that works at all. (This was one of the latest features, I think it was introduced in CUDA 12, where they already went overboard with random, questionable API modifications. This is one of the reasons why I gave up trying to follow their releases. And... NVIDIA is a poor company, they cannot afford to pay someone like me 🤡 ). Specifically: I don't know whether the cuGraphKernelNodeSetAttribute function can currently be used (or why anyone would want to do that). But in any case, this PR could go into the current master state, and then people could decide what to do with that (and if there ever is a new release, it will be part of that).

@bleenhou

Copy link
Copy Markdown
Author

I'll check that next week when I'm back from holiday.
I can add a unit test which will at least check that this change (and the other one you're suggesting) fixes the crash (even though checking that it actually has any effect would be complicated in a UT)

@jcuda

jcuda commented Apr 17, 2026

Copy link
Copy Markdown
Owner

You may have seen that there hardly is any "unit test" coverage. I usually tried to cover the most important features in https://github.com/jcuda/jcuda-samples, and regularly ran these samples after new releases. Given that JCuda is tracking another API (namely CUDA), and does so "blindly" with partially auto-generated code, "classical" unit tests didn't seem to make so much sense.
(Unit tests for cudnnRNNBackwardWeights_v8 anyone? 😁 )

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants