I am using Qt to build an interface to launch some of my cuda-enabled libraries from. As part of loading the GUI, I also have a gpuInit(); function called, so that this is not done when my cuda libraries are run so they are as responsive as possible.
As part of my code, my cuda enabled code is called in a differnt thread (only one thread actually making cuda calls), but this thread is different than the thread that called gpuInit();
Does this cause me to have two different contexts or something? How can I resolve this? Right now, my code is crashing on a cudaFree() call in my cuda code.