Is the driver-level API thread specific?

I’m aware that the Cuda Runtime API (cudaXXX functions) associate a GPU with the calling thread and require all calls to come from the same thread.

Does the same apply to the Driver-level API (cuXXX functions)?

Specifically, I want to use cuDeviceGet, cuMemGetInfo, cuDeviceGetProperties etc. from a single thread, to get info on all the GPUs in a system. It seems to work, but is it reliable?


The same does not apply to the driver API. You can make driver API calls from any thread.

Furthermore there should be a subset of Runtime API calls that do not associated a GPU with the calling thread, (get device count, get device properties, function get attributes, etc). – Don’t trust me on this one, we do this in Oceot, but I haven’t actually tested this using the NVIDIA Cuda Runtime –

Gregory is correct. It is only runtime API contexts which get tied to a particular thread. Those calls which don’t require or establish a context can be called from any thread, or from one thread to multiple GPUs without problems.