Hi,
I have a few questions about the capabilities of CudaRuntime for supporting multiple contexts.
Problem 1:
Let’s say I have a multi-threaded application, where each thread is a pthread. For simplicity, lets assume that there is no dependency between the threads. In other words, each
thread is independent from the other. Inside the thread function of each thread, I perform some cuda operations. Note that I am trying to run all the threads in the same GPU.
In this scenario I observe the following:
- When these threads are started at the same time (without any delay between creation of threads), they run to completion successfully.
- When I insert a sleep time between the creation of threads, some thread finish successfully, while others have some errors during launch. This is
consistent when I have 4 threads.
So, the question is, does cudaRuntime guarantee a correct support for multi-threaded programs? Or, in other words, does cudaRuntime handle thread context within a program correctly?
Problem 2:
Let’s say I am trying to run multiple applications on a single GPU at the same time. However, again, there might be some start delays between each application. I have tested this with a
set of applications. Sometimes, this mix has multiple instances of the same application or different applications itself.
Following are the observations:
- It runs to completion mostly when all the applications are started about the same time.
- When there is a sleep time between the start of various applications, I notice some “unspecified launch error”.
So, the question is, does cudaRuntime guarantee support for multiple applications on a single GPU at the same time?
I am using cuda 3.0 version.
If you have some information on this or have experienced this before, please share your thoughts with me. This will be of great help.
Thanks in advance!