From: Gregory Etelson <getelson@nvidia.com>
To: <dev@dpdk.org>
Cc: <getelson@nvidia.com>, <mkashani@nvidia.com>,
<rasland@nvidia.com>, "Bing Zhao" <bingz@nvidia.com>,
Elena Agostini <eagostini@nvidia.com>
Subject: [PATCH 9/9] gpu/cuda: support CUDA 13 building
Date: Mon, 15 Sep 2025 17:41:36 +0300 [thread overview]
Message-ID: <20250915144137.54858-9-getelson@nvidia.com> (raw)
In-Reply-To: <20250915144137.54858-1-getelson@nvidia.com>
From: Bing Zhao <bingz@nvidia.com>
The API name and prototype have been changed in the new CUDA, this
commit will ensure the compatibility with different versions.
Signed-off-by: Bing Zhao <bingz@nvidia.com>
---
drivers/gpu/cuda/cuda.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/drivers/gpu/cuda/cuda.c b/drivers/gpu/cuda/cuda.c
index e050b6370b..3f3391cf30 100644
--- a/drivers/gpu/cuda/cuda.c
+++ b/drivers/gpu/cuda/cuda.c
@@ -28,6 +28,28 @@ static CUresult CUDAAPI (*sym_cuGetProcAddress)(const char *symbol,
void **pfn, int cudaVersion, uint64_t flags);
/* CUDA Driver functions loaded with cuGetProcAddress for versioning */
+#if defined(CUDA_VERSION) && (CUDA_VERSION >= 13000)
+static PFN_cuGetErrorString_v6000 pfn_cuGetErrorString;
+static PFN_cuGetErrorName_v6000 pfn_cuGetErrorName;
+static PFN_cuPointerSetAttribute_v6000 pfn_cuPointerSetAttribute;
+static PFN_cuDeviceGetAttribute_v2000 pfn_cuDeviceGetAttribute;
+static PFN_cuDeviceGetByPCIBusId_v4010 pfn_cuDeviceGetByPCIBusId;
+static PFN_cuDevicePrimaryCtxRetain_v7000 pfn_cuDevicePrimaryCtxRetain;
+static PFN_cuDevicePrimaryCtxRelease_v11000 pfn_cuDevicePrimaryCtxRelease;
+static PFN_cuDeviceTotalMem_v3020 pfn_cuDeviceTotalMem;
+static PFN_cuDeviceGetName_v2000 pfn_cuDeviceGetName;
+static PFN_cuCtxGetApiVersion_v3020 pfn_cuCtxGetApiVersion;
+static PFN_cuCtxSetCurrent_v4000 pfn_cuCtxSetCurrent;
+static PFN_cuCtxGetCurrent_v4000 pfn_cuCtxGetCurrent;
+static PFN_cuCtxGetDevice_v2000 pfn_cuCtxGetDevice;
+static PFN_cuCtxGetExecAffinity_v11040 pfn_cuCtxGetExecAffinity;
+static PFN_cuMemAlloc_v3020 pfn_cuMemAlloc;
+static PFN_cuMemFree_v3020 pfn_cuMemFree;
+static PFN_cuMemHostRegister_v6050 pfn_cuMemHostRegister;
+static PFN_cuMemHostUnregister_v4000 pfn_cuMemHostUnregister;
+static PFN_cuMemHostGetDevicePointer_v3020 pfn_cuMemHostGetDevicePointer;
+static PFN_cuFlushGPUDirectRDMAWrites_v11030 pfn_cuFlushGPUDirectRDMAWrites;
+#else
static PFN_cuGetErrorString pfn_cuGetErrorString;
static PFN_cuGetErrorName pfn_cuGetErrorName;
static PFN_cuPointerSetAttribute pfn_cuPointerSetAttribute;
@@ -48,6 +70,7 @@ static PFN_cuMemHostRegister pfn_cuMemHostRegister;
static PFN_cuMemHostUnregister pfn_cuMemHostUnregister;
static PFN_cuMemHostGetDevicePointer pfn_cuMemHostGetDevicePointer;
static PFN_cuFlushGPUDirectRDMAWrites pfn_cuFlushGPUDirectRDMAWrites;
+#endif
static void *cudalib;
static unsigned int cuda_api_version;
--
2.48.1
prev parent reply other threads:[~2025-09-15 14:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-15 14:41 [PATCH 1/9] gpu/cuda: add NVIDIA GPU H100 Gregory Etelson
2025-09-15 14:41 ` [PATCH 2/9] gpu/cuda: new RoyB A100T GPU ID Gregory Etelson
2025-09-15 14:41 ` [PATCH 3/9] [gpu/cuda] New NVIDIA GPU Hopper device ID on Grace Gregory Etelson
2025-09-15 14:41 ` [PATCH 4/9] gpu/cuda: add new Hopper GPU IDs Gregory Etelson
2025-09-15 14:41 ` [PATCH 5/9] gpu/cuda: add new gpu hopper 80gb device id Gregory Etelson
2025-09-15 14:41 ` [PATCH 6/9] gpu/cuda: more gpu ID for h100 and l40 Gregory Etelson
2025-09-15 14:41 ` [PATCH 7/9] gpu/cuda: extend NVIDIA GPU device ID list Gregory Etelson
2025-09-15 14:41 ` [PATCH 8/9] " Gregory Etelson
2025-09-15 14:41 ` Gregory Etelson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250915144137.54858-9-getelson@nvidia.com \
--to=getelson@nvidia.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=eagostini@nvidia.com \
--cc=mkashani@nvidia.com \
--cc=rasland@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).