I want to set priority using TensorRT and make preemption by priority in GPU.
As far as I know, it is possible to give priority to a stream by using cuStreamCreateWithPriority() when creating a stream. Also, stream priorities are within a cuda context .
Here a question arises.
The context of cuda (CUcontext) and the ExecutionContext of tensorRT (IExecutionContext) are different.
Can preemption take place using streams with different priorities on different ExecutionContexts?
For example, ExecutionContext A use high priority stream a and ExecutionContext B use low priority stream b. Then, A can preempt B?
If the answer of #1 is true, then how about among different processes?
For instance, ExecutionContext A use high priority stream a in the application 1 and ExecutionContext B use low priority stream b in the application 2. Then, A can preempt B?
If the answer of #2 is false, then is there way to assign different priorities between different processes?
In addition, is there any relationship between CUcontext and IExecutionContext in terms of priority assignment?
Different CUcontext can not run concurrently (i.e., A GPU never runs work (kernels) from 2 or more contexts simultaneously . However, the IExecutionContexts can run concurrently [2-3]. Actually, I confirmed the running of different ExecutionContexts with different streams simultaneously through the experiment and nsight systems, and it shows great improvement. So, executions behaviors are different, then how about in terms of priority allocation?
 GPU sharing among different application with different CUDA context - CUDA / CUDA Programming and Performance - NVIDIA Developer Forums
 Can I inference two engine simultaneous on jetson using TensorRT? - Jetson & Embedded Systems / Jetson TX2 - NVIDIA Developer Forums
 Multiple concurrent Execution Contexts?