From dc3e4484dc83485734e503991fe5ed3bdf256fba Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Sun, 4 Jun 2023 10:26:35 -0700 Subject: [PATCH] Add cuDriverGetVersion 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 | 1 + include/ffnvcodec/dynlink_loader.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/ffnvcodec/dynlink_cuda.h b/include/ffnvcodec/dynlink_cuda.h index 99c4e46..ca474c6 100644 --- a/include/ffnvcodec/dynlink_cuda.h +++ b/include/ffnvcodec/dynlink_cuda.h @@ -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); diff --git a/include/ffnvcodec/dynlink_loader.h b/include/ffnvcodec/dynlink_loader.h index ed59e85..2f94c07 100644 --- a/include/ffnvcodec/dynlink_loader.h +++ b/include/ffnvcodec/dynlink_loader.h @@ -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");