Skip to content

Conversation

@fbusato
Copy link
Contributor

@fbusato fbusato commented Dec 15, 2025

Description

bug/5736804 workaround

@fbusato fbusato self-assigned this Dec 15, 2025
@fbusato fbusato requested a review from a team as a code owner December 15, 2025 22:36
@fbusato fbusato requested a review from ericniebler December 15, 2025 22:36
@fbusato fbusato added this to CCCL Dec 15, 2025
@github-project-automation github-project-automation bot moved this to Todo in CCCL Dec 15, 2025
@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Dec 15, 2025
Comment on lines 949 to 955
# if _CCCL_CTK_BELOW(13, 2)
if (::cuda::__driver::__version_below(13, 2))
{
const auto __tensorMapPtr = reinterpret_cast<::cuda::std::uint64_t*>(static_cast<void*>(&__tensorMap));
__tensorMapPtr[1] = ~(::cuda::std::uint64_t{1} << 21);
}
# endif // _CCCL_CTK_BELOW(13, 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# if _CCCL_CTK_BELOW(13, 2)
if (::cuda::__driver::__version_below(13, 2))
{
const auto __tensorMapPtr = reinterpret_cast<::cuda::std::uint64_t*>(static_cast<void*>(&__tensorMap));
__tensorMapPtr[1] = ~(::cuda::std::uint64_t{1} << 21);
}
# endif // _CCCL_CTK_BELOW(13, 2)
if (::cuda::__driver::__version_below(13, 2))
{
const auto __tensorMapPtr = reinterpret_cast<::cuda::std::uint64_t*>(static_cast<void*>(&__tensorMap));
__tensorMapPtr[1] = ~(::cuda::std::uint64_t{1} << 21);
}

We should just check the version at runtime. Can you also add a comment what this is and the nvbug number?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well, we can skip for newer CTK. Why making a driver call when it is not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you also add a comment what this is and the nvbug number?

sorry, the PR was not finalized yet

Copy link
Contributor

Choose a reason for hiding this comment

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

I am with @fbusato here, we should avoid driver calls if we can

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, but we can prevent the case when the user compiles with CUDA 13.2, but then runs the program with driver version 13.1. We do this already in some other APIs. We cache the driver version, so there should be almost no overhead at all.

I think preventing a bug has greater value than 1 version comparison.

Copy link
Contributor Author

@fbusato fbusato Dec 16, 2025

Choose a reason for hiding this comment

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

I double-checked. The driver version is encoded, so there is practically zero overhead when calling this function. I'm fine with this modification.
Anyway, I don't think it is possible to compile and run a code compiled with CUDA 13.2 with lower driver version. However, considering our support for non-conventional platforms, edge cases could still be possible.

@github-actions

This comment has been minimized.

@fbusato fbusato requested a review from davebayer December 16, 2025 18:38
@fbusato fbusato enabled auto-merge (squash) December 16, 2025 22:20
@github-actions
Copy link
Contributor

🥳 CI Workflow Results

🟩 Finished in 3h 43m: Pass: 100%/91 | Total: 1d 09h | Max: 3h 08m | Hits: 92%/214122

See results here.

@fbusato fbusato merged commit d91fc20 into NVIDIA:main Dec 17, 2025
103 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Dec 17, 2025
@github-actions
Copy link
Contributor

Backport failed for branch/3.0.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin branch/3.0.x
git worktree add -d .worktree/backport-6985-to-branch/3.0.x origin/branch/3.0.x
cd .worktree/backport-6985-to-branch/3.0.x
git switch --create backport-6985-to-branch/3.0.x
git cherry-pick -x d91fc2068118924215a8906c369a2bbd6cb1790c

@github-actions
Copy link
Contributor

Backport failed for branch/3.1.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin branch/3.1.x
git worktree add -d .worktree/backport-6985-to-branch/3.1.x origin/branch/3.1.x
cd .worktree/backport-6985-to-branch/3.1.x
git switch --create backport-6985-to-branch/3.1.x
git cherry-pick -x d91fc2068118924215a8906c369a2bbd6cb1790c

@github-actions
Copy link
Contributor

Backport failed for branch/3.2.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin branch/3.2.x
git worktree add -d .worktree/backport-6985-to-branch/3.2.x origin/branch/3.2.x
cd .worktree/backport-6985-to-branch/3.2.x
git switch --create backport-6985-to-branch/3.2.x
git cherry-pick -x d91fc2068118924215a8906c369a2bbd6cb1790c

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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants