Skip to content

vllm.distributed.device_communicators.cuda_wrapper

This file is a pure Python wrapper for the cudart library. It avoids the need to compile a separate shared library, and is convenient for use when we just need to call a few functions.

Classes:

CudaRTLibrary

Methods:

cudaGetLastError()

Return and clear the error pending on this thread.

cudaHostRegister(ptr, size, flags=0)

Return the raw error code instead of raising, since callers can fall back to pageable memory. Drain a failure with cudaGetLastError.

cudaHostUnregister(ptr)

Return the raw error code instead of raising.

cudaStreamCreateWithFlags(flags)

Create a stream on the current device; returns its raw handle.

Only used under NVIDIA Confidential Computing, so unlike exported_functions it is resolved on use: ROCm and non-CC processes never look it up.