Skip to content

memory: add cuda 13 support #2000

Merged
axboe merged 1 commit intoaxboe:masterfrom
maxime-peim:new-cuda-ctx-params
Oct 10, 2025
Merged

memory: add cuda 13 support #2000
axboe merged 1 commit intoaxboe:masterfrom
maxime-peim:new-cuda-ctx-params

Conversation

@maxime-peim
Copy link
Copy Markdown

In the latest cuda driver API, cuCtxCreate takes another parameter CUctxCreateParams.

@vincentkfu
Copy link
Copy Markdown
Collaborator

This will fail if the build environment has a CUDA version before 13.0. We should have a test in the configure script that detects whether this additional parameter is required and uses the new function signature only if it is required.

Here is an example of a similar change: f95cf49

Also please add to the bottom of the commit message:

Fixes: 1988

@sitsofe
Copy link
Copy Markdown
Collaborator

sitsofe commented Oct 10, 2025

@maxime-peim Could you also change the commit's title to something like

memory: add cuda 13 support 

@maxime-peim
Copy link
Copy Markdown
Author

Sure, let me add these

@maxime-peim maxime-peim changed the title fix: update cuCtxCreate parameters memory: add cuda 13 support Oct 10, 2025
@maxime-peim maxime-peim force-pushed the new-cuda-ctx-params branch 3 times, most recently from 99bae54 to a2e3a55 Compare October 10, 2025 08:05
configure Outdated
{
int ver;
cuDriverGetVersion(&ver);
return ver >= 13000 ? 0 : -1;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I don't see how this works, as nothing looks at this exit value. In other words, this will end up being true if it compiles, which presumably it'll do for both version 13 or below, not really checking what you'd want.

Why isn't this just doing

cuCtxCreate(NULL, NULL, 0, NULL);

and check if that compiles (which is what compile_prog does)? We already know we have cuda when this test is compiled, hence we just need to check if a 4-parameter cuCtxCreate compiles or not. If it does, hopefully this is cuda >= 13, if it doesn't then it should be < 13.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Totally, sorry, I don't know why I thought that if compilation passes then we execute the resulting binary to check the results.
I'll update the PR

In the latest cuda driver API (13.0), cuCtxCreate takes another
parameter CUctxCreateParams.

Fixes: axboe#1988
Signed-off-by: Maxime Peim <maxime.peim@gmail.com>
@axboe
Copy link
Copy Markdown
Owner

axboe commented Oct 10, 2025

That looks better!

@axboe axboe merged commit 98f7e98 into axboe:master Oct 10, 2025
axboe added a commit that referenced this pull request Oct 10, 2025
A previous commit added the 4 argument variant, but then also messed
up the previous one at the same time. Fix it up.

Link: #2000
Fixes: acce4fc ("memory: add cuda 13 support")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
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.

4 participants