'CUDA process life time

It seems I didn't understand something essential about CUDA. I am using a C++ GUI application to start some kernels on a dual GPU card. When I start the host process, no process is listed by nvidia-smi. This is expected because the host process waits until I click a button before it uses CUDA and starts the kernels. If I push the button, the two kernels run fine on both GPUs, exit and return the expected results. The host process then is listed two times by nvidia-smi, once for each GPU. Both processes are visible in nvidia-smi until I exit the host process.

I am a bit confused since there is no such thing as a cudaOpen() or cudaClose() function (or a similar function pair).

Which CUDA API call(s) cause a process to be listed by nvidia-smi? Which CUDA API call(s) cause a process to be dropped from the list?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source