Hello, I have a question about how Green Context assigns SMs, as I haven’t been able to find much information on this. My question is the following:
From what I understand, when a Green Context is created, it is assigned a number of SMs, which, as far as I’ve been able to verify, are not assigned exclusively. Now, if I create another Green Context either within the same code or by launching the same code twice does Green Context at least guarantee that the SMs assigned to each process are not the same?
For example, if my system has 10 SMs and I launch my code that creates a Green Context using 5 SMs, then I launch the same code a second time, even though Green Context does not assign them exclusively, does it at least ensure that the assigned SMs do not overlap?
Do you even have a guarantee that the assigned SMs stay the same? If they are non-exclusively assigned, perhaps only the used number of SMs is constant or limited by green context?
Actually, I don’t know. This is part of the questions I’m trying to answer, because I haven’t been able to find anything about whether it’s possible to monitor the activity of each SM individually. Therefore, I’m not sure if I can answer those questions, or if someone else might be able to explain how the GPU itself behaves when assigning these SMs.
Hi Curefab, thanks a lot for the suggestion; it looked very promising. In my tests I’ve found that %smid returns the SM identifier relative to the framework’s green context, so it’s always numbered (e.g. 0–4 or 0–6) regardless of whether I launch them in parallel. Do you know any way to obtain the absolute GPU id instead of the id relative to the green context?