Add cuDriverGetVersion
authorPhilip Langdale <philipl@overt.org>
Sun, 4 Jun 2023 17:26:35 +0000 (10:26 -0700)
committerPhilip Langdale <philipl@overt.org>
Sun, 4 Jun 2023 17:26:35 +0000 (10:26 -0700)
This allows the caller to establish what cuda driver version is in use.
I'm surprised we got this far without needing it.

include/ffnvcodec/dynlink_cuda.h
include/ffnvcodec/dynlink_loader.h

index 99c4e4628ca2864ef10ed6be99ae99208dfbbc05..ca474c6475d865ef51eb495cb8379a41a5d414b4 100644 (file)
@@ -416,6 +416,7 @@ typedef struct CUeglFrame_st {
 typedef void CUDAAPI CUstreamCallback(CUstream hStream, CUresult status, void *userdata);
 
 typedef CUresult CUDAAPI tcuInit(unsigned int Flags);
+typedef CUresult CUDAAPI tcuDriverGetVersion(int *driverVersion);
 typedef CUresult CUDAAPI tcuDeviceGetCount(int *count);
 typedef CUresult CUDAAPI tcuDeviceGet(CUdevice *device, int ordinal);
 typedef CUresult CUDAAPI tcuDeviceGetAttribute(int *pi, CUdevice_attribute attrib, CUdevice dev);
index ed59e855b6df133e4401fee6020a9a5b6d32ec5d..2f94c077fb10cf966144671ba2e386bcd0ce5c75 100644 (file)
@@ -137,6 +137,7 @@ error:                              \
 #ifdef FFNV_DYNLINK_CUDA_H
 typedef struct CudaFunctions {
     tcuInit *cuInit;
+    tcuDriverGetVersion *cuDriverGetVersion;
     tcuDeviceGetCount *cuDeviceGetCount;
     tcuDeviceGet *cuDeviceGet;
     tcuDeviceGetAttribute *cuDeviceGetAttribute;
@@ -307,6 +308,7 @@ static inline int cuda_load_functions(CudaFunctions **functions, void *logctx)
     GENERIC_LOAD_FUNC_PREAMBLE(CudaFunctions, cuda, CUDA_LIBNAME);
 
     LOAD_SYMBOL(cuInit, tcuInit, "cuInit");
+    LOAD_SYMBOL(cuDriverGetVersion, tcuDriverGetVersion, "cuDriverGetVersion");
     LOAD_SYMBOL(cuDeviceGetCount, tcuDeviceGetCount, "cuDeviceGetCount");
     LOAD_SYMBOL(cuDeviceGet, tcuDeviceGet, "cuDeviceGet");
     LOAD_SYMBOL(cuDeviceGetAttribute, tcuDeviceGetAttribute, "cuDeviceGetAttribute");