Jan 12
16
Cuda CUDA_ERROR_INVALID_CONTEXT when calling cuMemGetInfo
Leave a comment »
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