GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
libgomp/nvptx

libgomp NVIDIA GPU plugin targets CUDA 13 API changes

Fixes libgomp's NVIDIA GPU plugin build with CUDA 13's cuCtxCreate API changes.

CUDA 13 introduced API changes to cuCtxCreate, altering its signature and internally aliasing it to cuCtxCreate_v4. This commit updates libgomp’s NVPTX plugin to correctly handle this new signature, resolving compilation errors that occurred when building with CUDA 13 under the PLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H configuration.

In Details

When PLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H is used, libgomp's NVPTX plugin compiles against the system's CUDA headers. CUDA 13 changed the cuCtxCreate API signature to CUctxCreateParams * for the second argument, requiring an update in libgomp's nvptx_open_device function to pass the correct number of arguments to the cuCtxCreate_v4 trampoline.

For Context
cuCtxCreate
An NVIDIA CUDA driver API function used to create a CUDA context on a specified device.
cuCtxCreate_v4
A versioned CUDA API function, used internally by the driver, that implements the cuCtxCreate functionality. CUDA 13 changed the signature of this function.
CUctxCreateParams
A structure introduced in CUDA 13 to pass parameters to cuCtxCreate, changing the API signature.
PLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H
A preprocessor macro that, when defined, instructs libgomp's NVPTX plugin to include the system's CUDA header files instead of GCC's internal version.
Filed Under: gpucudalibgompapi