Skip to content

feat(cuda): add driver context and resource ownership - #10720

Merged
0ax1 merged 1 commit into
developfrom
ad/cuda-driver-resources
Oct 23, 2026
Merged

0ax1 merged 1 commit into
developfrom
ad/cuda-driver-resources

Conversation

@0ax1

@0ax1 0ax1 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Raw CUDA handles do not manage ownership, thread-context binding, or cleanup errors.

Solution

Add owned and borrowed contexts, streams, events, and modules with explicit binding and deferred error handling.

Assessment

Depends on #10719. The crate remains unpublished; consumers switch in #10722.

@codspeed

codspeed Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 5.52%

2 warnings, 1 note

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ 22 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

ℹ️ 40 benchmarks have no flamegraph

The flamegraph wasn't generated: the symbols of the profiling trace could not be resolved, because no information about the language frames was collected.

See affected benchmarks

⚡ 1 improved benchmark
❌ 3 regressed benchmarks
✅ 2404 untouched benchmarks
⏩ 12 skipped benchmarks1
🗄️ 43 archived benchmarks run2

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Walltime filter_neon[64] 1.9 µs 2.3 µs -15.33%
❌ Walltime filter_neon[8] 1.4 µs 1.7 µs -15.07%
❌ Walltime starts_with_avx512[8, VarBin] 39.9 µs 45.2 µs -11.77%
⚡ CPU Simulation take[routing/alternating_chunks/primitive/nonnull/chunks=32/indices=1000] 247.1 µs 196.7 µs +25.61%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ad/cuda-driver-resources (b896d5d) with develop (1de85c8)

Open in CodSpeed

Footnotes

  1. 12 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. 43 benchmarks were run, but are now archived. If they were deleted in another branch, consider rebasing to remove them from the report. Instead if they were added back, click here to restore them. ↩

@0ax1 0ax1 added the changelog/feature A new feature label Oct 23, 2026 — with ChatGPT Codex Connector
@0ax1
0ax1 force-pushed the ad/cuda-driver-resources branch from 8390bc7 to 7085828 Compare October 23, 2026 13:13
@0ax1
0ax1 force-pushed the ad/cuda-driver-bindings branch from 60b9ab5 to 172564e Compare October 23, 2026 13:13
@0ax1
0ax1 requested a review from robert3005 October 23, 2026 14:50
@0ax1
0ax1 marked this pull request as ready for review October 23, 2026 14:51
@0ax1
0ax1 force-pushed the ad/cuda-driver-bindings branch from 172564e to 3c6c195 Compare October 23, 2026 15:46
0ax1 added a commit that referenced this pull request Oct 23, 2026
## Problem

The driver replacement needs a small CUDA binding layer with lazy library loading.

## Solution

Add raw handles, symbols, errors, and fallible call wrappers in `vortex-cuda-driver`.

## Assessment

The crate is excluded from publishing; existing consumers still use cudarc. Based on #10726 and prerequisite for #10720.

Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Base automatically changed from ad/cuda-driver-bindings to develop October 23, 2026 15:59
Add owned and borrowed CUDA resources, explicit thread-context binding, stream and event synchronization, module loading, and deferred driver errors. Stage allocation helpers and event pooling with the memory-tracking change that consumes them.

Original-commit: 5fd3f54eba
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
@0ax1
0ax1 force-pushed the ad/cuda-driver-resources branch from 7085828 to b896d5d Compare October 23, 2026 16:00
@0ax1
0ax1 merged commit b702068 into develop Oct 23, 2026
89 of 90 checks passed
@0ax1
0ax1 deleted the ad/cuda-driver-resources branch October 23, 2026 16:33
0ax1 added a commit that referenced this pull request Oct 23, 2026
## Problem

Device memory shared across streams needs ordered access and deallocation without redundant waits.

## Solution

Add typed allocations/views, copies, pointer guards, pooled access events, and kernel launches.

## Assessment

Depends on #10720; activated by #10722. The driver remains excluded from publishing.

Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants