mlco2 / codecarbon

Track emissions from Compute and recommend ways to reduce their impact on the environment.
https://mlco2.github.io/codecarbon
MIT License
1.18k stars 177 forks source link

Log steps to install needed codecarbon dependencies #585

Closed inimaz closed 1 month ago

inimaz commented 5 months ago

Description

A new user comes and starts using codecarbon. It would be nice if we had a function that:

  1. returns/logs the CPU/GPU/RAM of the user
  2. if needed gives back the specific dependencies to be installed + the codecarbon limitations on the user's hardware.

Currently we log many things

2024-06-19 11:23:24.690 [info] [codecarbon INFO @ 11:23:24] Tracking Nvidia GPU via pynvml

2024-06-19 11:23:24.691 [info] [codecarbon DEBUG @ 11:23:24] GPU available. Starting setup

2024-06-19 11:23:24.728 [info] [codecarbon INFO @ 11:23:24] [setup] CPU Tracking...

2024-06-19 11:23:24.728 [info] [codecarbon DEBUG @ 11:23:24] Not using PowerGadget, an exception occurred while instantiating IntelPowerGadget : Platform not supported by Intel Power Gadget

2024-06-19 11:23:24.728 [info] [codecarbon DEBUG @ 11:23:24] Not using the RAPL interface, an exception occurred while instantiating IntelRAPL : Intel RAPL files not found at /sys/class/powercap/intel-rapl on linux

2024-06-19 11:23:24.728 [info] [codecarbon DEBUG @ 11:23:24] Not using PowerMetrics, an exception occurred while instantiating Powermetrics : Platform not supported by Powermetrics

2024-06-19 11:23:24.728 [info] [codecarbon WARNING @ 11:23:24] No CPU tracking mode found. Falling back on CPU constant mode.

2024-06-19 11:23:26.197 [info] [codecarbon DEBUG @ 11:23:26] CPU : We detect a 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz with a TDP of 45.0 W

2024-06-19 11:23:26.197 [info] [codecarbon INFO @ 11:23:26] CPU Model on constant consumption mode: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz

2024-06-19 11:23:26.214 [info] [codecarbon INFO @ 11:23:26] >>> Tracker's metadata:

2024-06-19 11:23:26.214 [info] [codecarbon INFO @ 11:23:26]   Platform system: Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.31

2024-06-19 11:23:26.214 [info] [codecarbon INFO @ 11:23:26]   Python version: 3.12.0

2024-06-19 11:23:26.214 [info] [codecarbon INFO @ 11:23:26]   CodeCarbon version: 2.4.2

2024-06-19 11:23:26.214 [info] [codecarbon INFO @ 11:23:26]   Available RAM : 7.621 GB

2024-06-19 11:23:26.214 [info] [codecarbon INFO @ 11:23:26]   CPU count: 16

2024-06-19 11:23:26.214 [info] [codecarbon INFO @ 11:23:26]   CPU model: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz

2024-06-19 11:23:26.214 [info] [codecarbon INFO @ 11:23:26]   GPU count: 1

2024-06-19 11:23:26.214 [info] [codecarbon INFO @ 11:23:26]   GPU model: 1 x NVIDIA GeForce RTX 3050 Ti Laptop GPU

2024-06-19 11:23:27.218 [info] [codecarbon DEBUG @ 11:23:27] Not running on AWS

2024-06-19 11:23:28.220 [info] [codecarbon DEBUG @ 11:23:28] Not running on Azure

2024-06-19 11:23:29.222 [info] [codecarbon DEBUG @ 11:23:29] Not running on GCP

But maybe it could be more explicit. Like please install X to measure your CPU.

inimaz commented 5 months ago

An example where this would have been helpful ==> #583

rosekelly6400 commented 3 months ago

Hi @inimaz, still hoping to contribute to this project. Is this issue still open or are there any other bugs/enhancements that I could take on? Happy to help with whatever

benoit-cty commented 3 months ago

Welcome @rosekelly6400, You can take this issue or have a look to label https://github.com/mlco2/codecarbon/labels/good%20first%20issue

And read https://github.com/mlco2/codecarbon/blob/master/CONTRIBUTING.md

If you need help, don't hesitate to open a discussion in https://github.com/mlco2/codecarbon/discussions

rosekelly6400 commented 3 months ago

@benoit-cty Great, thanks! I'll take this issue then

astrojuanlu commented 1 month ago

Closed in #641?

rosekelly6400 commented 1 month ago

ah sorry I forgot to update this issue but yes @astrojuanlu changes for this were made and merged in that pull request

SaboniAmine commented 1 month ago

Closing then. Thanks!