haadate.blogg.se

Cuda driver api
Cuda driver api










cuda driver api

Find the GPU which is selected by VulkanĬudaGetDeviceProperties(&deviceProp, current_device) Here is my example codes: #define CUDA_DRIVER_APIĬheckCudaErrors(cuCtxGetCurrent(&context)) įprintf(stdout, "current context=%p\n", context) ĬheckCudaErrors( cuCtxGetApiVersion(context, &api_ver)) įprintf(stdout, "current context api version = %d\n", api_ver) ĬheckCudaErrors(cudaGetDeviceCount(&device_count)) įprintf(stderr, "CUDA error: no devices supporting CUDA.\n") I always raise error saying context has been destroyed or invalid.

cuda driver api

That is initialize the runtime first then do cuCtxGetCurrent() and use it in cuda driver api. then I can use cuda runtime functions without call cudaSetDevice(), which implicitly create a new primary context. This context can be used by subsequent driver API calls. If the runtime is initialized (implicitly as mentioned in CUDA Runtime), cuCtxGetCurrent() can be used to retrieve the context created during initialization.If a context is created and made current via the driver API, subsequent runtime calls will pick up this context instead of creating a new one.












Cuda driver api