Hey everyone,
I have an application that is multithreaded and I am in a situation where thread 1 is allocating memory with a simple cudaMalloc. Later in my application, thread 2 tries to memset this memory.
In my understanding this is possible since CUDA 3.2 (CUDA contexts can be shared between host threads). I’m running Ubuntu 12.04, CUDA 5.0 and latest graphics driver (310.19). I have two graphics cards: a GeForce 680 running the graphics and a GeForce 580 running my CUDA kernels (my kernels are executing faster on the 580). In that exact configuration, the memset fails with a ‘invalid argument’. Of course, I checked the size and the address and they both seem fine.
If I execute the CUDA computations on the GeForce 680 as well (I have defined an environment variable to do that, so both graphics and CUDA use the same card), everything works fine then. No error.
The type of error ‘invalid argument’ is the same type of error we used to have when sharing contexts between host threads was not possible before CUDA 3.2 ([url]cuda - cudaMemcpy invalid argument - Stack Overflow).
Could it be a bug in CUDA 5.0 at the moment? I don’t have a small executable to replicate the bug yet, but I will try to make one. Someone has an idea?
Thanks for your help.