Cuda CUDA_ERROR_INVALID_CONTEXT when calling cuMemGetInfo

Problem
Calling cuMemGetInfo returns the result 201 (CUDA_ERROR_INVALID_CONTEXT)

Cause
The most common cause is that a context has not been initialised on the current host thread.

Solution
In your host application before calling cuMemGetInfo make a once off call to create a context. For an example of this see my post CUDA Get Amount of Free Global Device Memory

Leave a Comment

Page optimized by WP Minify WordPress Plugin