Repository navigation
Avoid nvJitLink cache crashes during incremental LTO - #3040
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Retain cached backend version cuda_core/cuda/core/_linker.pyx |
The cached-backend return path no longer resets _nvjitlink_version to None. |
Document and apply cache option cuda_core/cuda/core/_linker.pyi, cuda_core/cuda/core/_linker.pyx, cuda_core/tests/test_linker.py |
The option documentation describes automatic cache disabling for incremental LTO links on nvJitLink versions older than 13.6. The options builder emits -no-cache when the version and linking options meet that condition, or when no_cache is true. The test covers versions 13.4, 13.5, 13.6, and 14.0 and all combinations of the relevant options. |
Change: Bug fix
Merge Risk: 
Minimal · up to 16f89
-
The reviewed change has no identified issue requiring a fix before merge. Rebuilt-extension validation and confirmation in the original CI environment remain pending.
There was a problem hiding this comment.
@GodlyDonuts this comes out of blue. Could you please present your analysis on why you think the linker cache is to blame? For example, a stack trace when the segfault happens would be nice.
|
The original CI failure happens during the first incremental LTO link, but that traceback alone doesn’t prove caching is the cause. I reduced the path to nvJitLink directly and tested it through both With caching enabled, 7/8 processes failed across the two paths. With The crash dump lands inside This supports the workaround but actual confirmation against the CI failures is still pending. |
|
Here is the native stack excerpt from the local reproduction, captured with caching enabled and one worker thread. Personal paths and machine metadata have been removed. The faulting instruction dereferences |
|
@claude review this PR |
|
Thanks, @GodlyDonuts. I have shared your traceback with the compiler team and they are looking into it. I'll keep you posted, though at this point we cannot yet establish that the cache is to blame and accept this PR; the compiler team is against turning off the cache. |
leofang
left a comment
There was a problem hiding this comment.
Thanks for your patience and data, @GodlyDonuts, our compiler team was able to confirm and fix a use-after-free bug. A future release of nvJitLink will fix it and in the meanwhile they agreed turning off cache is an acceptable workaround. Let's get this PR in!
6bf45f4 to
ebab5f5
Compare
|
Thanks for confirming! Added the pre-13.6 guard, updated the docs and tests, and rebased onto main. |
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: NVIDIA/cuda-python
- Branch: main
- File: .coderabbit.yaml
- Commit: 01037b1
- Layers: Repository YAML
- Review profile: CHILL
- Plan: Enterprise
- Run ID:
6606499f-9ff9-4d6a-a64d-737e1c06191a
Files selected for processing: 3-
cuda_core/cuda/core/_linker.pyicuda_core/cuda/core/_linker.pyxcuda_core/tests/test_linker.py
Files skipped from review as they are similar to previous changes: 1-
- cuda_core/cuda/core/_linker.pyi
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
-
|
/ok to test 16f89fa |
|
Related to #3038.
Disable nvJitLink's intermediate cache when incremental linking and link-time optimization are both enabled. Repeated native round trips reproduced access violations on Windows with caching enabled, including through direct calls that bypass cuda-bindings.
Apply
-no-cacheat every incremental LTO stage, document the behavior, and add regression coverage for option generation. Other linking modes retain their existing caching behavior.Validation:
git diff --checkpassed.Draft pending rebuilt-extension validation and confirmation against the original MCDM CI environment. This mitigates the reproduced failure; it does not establish that every crash in #3038 has the same cause.