Get a signal when any new process starts

Multi tool use
In python, is there a way under Linux to get a signal each time a new process starts? And in particular when a process with compute context on an Nvidia GPU starts? Or do I need to use a loop that calls ps or nvidia-smi?
NVIDIA maintain an API for querying the state of the CUDA ecosystem from user code called NVML(NVIDIA Management Library).
I am unaware of any Python bindings for the API, but it would not be too difficult to use it via the method of your choice (eg. this or this). You would need to poll, it doesn't support signalling. I assume that nvidia-smi uses NVML internally.
I don't believe there is any sort of Linux user space API which would allow notification of new process creation, CUDA enabled or otherwise.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.