Open enricocapuano opened 1 month ago
Hello @enricocapuano ! Thanks for using codecarbon
.
We added this as a lock so that only one instance is running at the same time in the machine, otherwise you will be measuring twice the same CPU/GPU/RAM energy, power...
That said, to understand your use case better, why do you need more than one instance of the tracker running at the same time?
Hello @inimaz, thanks for answering! I need to do a comparison about consumptions between two different processes that do the same thing in different ways. Do you have any suggestions?
Can you provide an example of your code? Normally as long as they are not run in parallel, there should be no problem with your use case.
Running them is parallel is not supported by CodeCarbon as, for now, we monitor the whole machine and not only the process. There is a 'process' mode but it only support RAM usage, not CPU nor GPU yet.
Ok, thanks for answering. I have another question: once I received that error, how can I fix it? Should I necessarily create another project? Thanks in advance
If you still have the error running only one instance then it is a bug, could you provide an example of how you are running it in your code?
A workaround until the fix is ready is to remove manually the lock file. It is a file .codecarbon.lock
that will be in your temp dir (in linux: /tmp, in windows: C:\Users\username\AppData\Local\Temp).
rm /tmp/.codecarbon.lock
Thanks again. I already tried to remove the lock file and it did not work. Anyway, it seems that I solved my issue setting the parameter allow_multiple_runs as True when creating tracker instance. Thank you for the support!
Nice! Then it means you were running things in parallel. Could you provide an example of your code? Otherwise it is hard to guess
Goodmorning! I'm trying to use the last version of CodeCarbon and I'm facing this problem: when I create more than one instance of tracker in my file, I receive this error. [codecarbon ERROR @ 13:41:42] Error: Another instance of codecarbon is already running. Turn off the other instance to be able to run this one. Exiting. [codecarbon WARNING @ 13:41:42] Another instance of codecarbon is already running. Exiting.
Is it possible to create more than one instance of tracker or not? How can I do it?