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

Was my post helpful? :)
Leave a Comment

Notify via Email Only if someone replies to My Comment