Skip to content

cuda: support CUDA toolkits older than 12.2#494

Open
giannisanni wants to merge 1 commit into
antirez:mainfrom
giannisanni:cuda-legacy-toolkit-compat
Open

cuda: support CUDA toolkits older than 12.2#494
giannisanni wants to merge 1 commit into
antirez:mainfrom
giannisanni:cuda-legacy-toolkit-compat

Conversation

@giannisanni

@giannisanni giannisanni commented Jul 4, 2026

Copy link
Copy Markdown

The CUDA backend uses the cudaMemLocation overloads of cudaMemAdvise() and cudaMemPrefetchAsync(), introduced in CUDA 12.2. Older toolkits (e.g. Ubuntu 24.04 ships nvcc 12.0) fail to build:

ds4_cuda.cu(909): error: no suitable conversion function from "cudaMemLocation" to "int" exists

This PR adds two inline overloads guarded by CUDART_VERSION < 12020 that forward to the legacy int-device signatures (cudaCpuDeviceId when the location is host). On 12.2+ the block compiles to nothing.

Tested on Linux / nvcc 12.0 / driver 580.82 / RTX 4060 Ti 16GB (sm_89): builds clean, and --ssd-streaming inference on DeepSeek V4 Flash q2 runs correctly (2.2 t/s generation streaming from a PCIe 3 NVMe, 28.7 t/s prefill on a ~1k token prompt - happy to share fuller consumer-hardware benchmark data if useful).

The CUDA backend uses the cudaMemLocation overloads of cudaMemAdvise()
and cudaMemPrefetchAsync(), which were introduced in CUDA 12.2. On
systems with an older toolkit (e.g. Ubuntu 24.04 ships nvcc 12.0) the
build fails with:

    ds4_cuda.cu(909): error: no suitable conversion function from
    "cudaMemLocation" to "int" exists

Add inline overloads, guarded by CUDART_VERSION < 12020, that forward
to the legacy int-device signatures. Compiles to nothing on 12.2+.

Tested on Linux, nvcc 12.0, driver 580.82, RTX 4060 Ti (sm_89):
builds clean and SSD streaming inference runs correctly.
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.

1 participant