Written and maintained by CASRAI Editorial Board
Published · Last updated
On this page
CodeCarbon is an open-source Python software package that measures and estimates the carbon dioxide equivalent (CO2eq) emissions produced by computing hardware during the execution of software workloads. Developed through a collaboration between Mila (the Quebec Artificial Intelligence Institute), BCG GAMMA, Haverford College, and Comet.ml, CodeCarbon samples real-time power consumption from central processing units (CPUs), graphics processing units (GPUs), and system memory (RAM), integrates energy usage over time, and multiplies the resulting kilowatt-hours by location-specific or cloud provider grid carbon intensity factors to generate verifiable environmental impact metrics.
What it is used for in research
Modern scientific computing and machine learning research demand substantial computational power. Deep neural network training runs, high-throughput genomic pipelines, and complex numerical simulations routinely require hundreds or thousands of accelerator hours. Historically, computational intensity has been reported almost exclusively through hardware execution time, floating-point operations (FLOPs), or processor counts. However, growing awareness of environmental externalities has led scientific societies, academic publishers, and funding bodies to demand empirical reporting of energy consumption and greenhouse gas footprints. Within this research landscape, CodeCarbon serves several critical operational and analytical functions.
First, CodeCarbon enables researchers to quantify and report the carbon footprint of their experiments with empirical precision. In scientific publications, researchers use CodeCarbon to document the environmental cost of novel architectures, training runs, or data processing pipelines, fulfilling reporting criteria for machine learning reproducibility checklists, model cards, and conferences that advocate green computing. Tracking the training carbon footprint allows authors to disclose the direct Scope 2 emissions resulting from purchased electricity consumed by dedicated computing resources. Evaluating a project’s aggregate compute carbon footprint across iterative development cycles provides reviewers and research institutions with a verifiable accounting of computational expenditures.
Second, CodeCarbon facilitates comparative algorithmic efficiency research. Rather than evaluating algorithms solely on traditional performance metrics such as accuracy, F1 score, or throughput, researchers can analyze the pareto frontier balancing performance against energy consumption. A slightly smaller model or an optimized numerical routine might sacrifice a negligible fraction of task accuracy while reducing electrical power requirements by forty percent. By recording energy consumption at fine-grained execution intervals, researchers can systematically benchmark alternative model architectures, precision formats such as FP16, BF16, or INT8, and training hyperparameter configurations.
Third, research computing facilities and university research offices utilize CodeCarbon to audit facility-wide emissions and fulfill institutional sustainability pledges. Many academic institutions are subject to national climate targets, university-wide net-zero commitments, or funder sustainability mandates such as the European Green Deal or UK Research and Innovation environmental policies. Incorporating CodeCarbon into shared research computing clusters provides administrators with transparent, project-specific attribution data without relying exclusively on coarse data center billing estimates. When establishing institutional data governance and infrastructure policies, tracking emissions data directly aligns with a comprehensive software management plan that governs scientific computational workflows.
Fourth, CodeCarbon provides empirical telemetry for artifact evaluation badges and peer review transparency. In computer systems, programming languages, and artificial intelligence, conferences often require authors submitting artifact packages to provide complete runtime environments and resource profiles. By coupling reproducible package specifications in GNU Guix or container definitions with CodeCarbon tracking scripts, researchers ensure that reviewers can verify not only functional reproducibility but also the computational resource envelope required to replicate published findings, reinforcing standards documented in a formal software paper.
How to install or access it
CodeCarbon is maintained as an open-source project hosted on GitHub by the mlco2 organization and published on the Python Package Index (PyPI). To ensure stability and reproducibility in research environments, always install CodeCarbon from official package repositories rather than untrusted mirrors or third-party forks. CodeCarbon requires Python 3.8 or newer.
The standard installation method for virtual environments (such as venv or virtualenv) utilizes pip directly from PyPI:
pip install codecarbon
For scientific research teams managing dependencies through Conda or Mamba, CodeCarbon is officially maintained on the community-curated conda-forge channel. Note that the legacy standalone channel named codecarbon is outdated and no longer maintained. To install the current release in an active Conda environment, run:
conda install -c conda-forge codecarbon
Depending on the host hardware platform and monitoring objectives, additional system libraries or dependencies may be necessary:
- NVIDIA GPU Monitoring: CodeCarbon interacts with the NVIDIA Management Library (NVML) via the pynvml (nvidia-ml-py) library. When running on systems equipped with NVIDIA GPUs, ensure the official proprietary NVIDIA display driver and CUDA toolkit are installed; CodeCarbon automatically discovers and queries the driver runtime.
- AMD GPU Monitoring: On systems equipped with AMD Instinct or Radeon accelerator cards, CodeCarbon interfaces with AMD SMI (amdsmi). Ensure the ROCm kernel drivers and management libraries are properly configured in your system environment.
- Linux CPU Hardware Telemetry: To enable hardware-level energy readings from modern Intel and AMD processors, the Linux Running Average Power Limit (RAPL) sysfs interface must be readable by the executing user process. Operating system permissions for RAPL are detailed in the troubleshooting section below.
To verify that CodeCarbon has installed correctly and inspect the hardware telemetry interfaces detected on your local machine, execute the built-in diagnostic CLI command:
codecarbon detect
The detect command outputs a structured inventory of discovered processors, accelerator devices, memory capacity, and active telemetry backends, confirming whether hardware power counters or fallback estimation models will be utilized during execution.
Step-by-step task
Tracking the emissions of a research computing workflow with CodeCarbon can be accomplished through programmatic Python instrumentation or via zero-code terminal wrappers. The following numbered steps demonstrate the complete workflow from environment configuration to granular execution profiling.
Step 1: Configure project settings and regional metadata
CodeCarbon resolves operational parameters through a hierarchical configuration system. Options are evaluated in order of precedence: inline instantiation parameters, environment variables prefixed with CODECARBON_, a local configuration file (.codecarbon.config in the working directory), and finally a global configuration file (~/.codecarbon.config). Create a local configuration file named .codecarbon.config in your project root to standardize reporting parameters across project collaborators:
[codecarbon]
project_name = rse_simulation_benchmark
measure_power_secs = 15
tracking_mode = machine
log_level = INFO
save_to_file = true
output_dir = ./emissions_reports
output_file = emissions.csv
Setting measure_power_secs controls the background polling interval (in seconds) at which hardware power draws are sampled. While a shorter interval provides finer temporal resolution, the default 15-second interval maintains negligible telemetry overhead for long-running computational jobs.
Step 2: Programmatic tracking using explicit start and stop calls
For modular scripts and command-line entry points, instantiate the EmissionsTracker class, trigger measurement at the beginning of the computational payload, and finalize tracking upon completion:
from codecarbon import EmissionsTracker
# Initialize tracker with project metadata
tracker = EmissionsTracker(project_name="neural_network_training")
# Start background monitoring thread
tracker.start()
# Execute heavy computation workload
train_model(epochs=50, batch_size=64)
# Halt tracking, flush metrics, and calculate emissions
emissions_kg = tracker.stop()
print(f"Total computation emissions: {emissions_kg:.6f} kg CO2eq")
Invoking stop() terminates the background monitoring thread, performs numerical integration of power samples across the elapsed run duration, applies regional carbon intensity coefficients, appends a record to emissions.csv, and returns total emissions in kilograms of CO2eq.
Step 3: Exception-safe tracking with Python context managers
In research workflows prone to out-of-memory errors or runtime exceptions, wrapping computations in Python context managers guarantees that collected telemetry is properly flushed to disk even if the workload terminates unexpectedly:
from codecarbon import EmissionsTracker
with EmissionsTracker(project_name="matrix_factorization", output_dir="./output") as tracker:
compute_svd_decomposition(large_dataset)
Upon exiting the context block, the tracker automatically invokes stop(), ensuring that partial energy metrics are not lost during aborted experiments.
Step 4: Non-invasive function tracking with decorators
If you prefer not to modify the internal control flow of your research functions, CodeCarbon provides a clean decorator syntax that wraps designated functions:
from codecarbon import track_emissions
@track_emissions(project_name="hyperparameter_search", output_dir="./metrics")
def run_optimization_pipeline(params):
results = evaluate_model(params)
return results
if __name__ == "__main__":
run_optimization_pipeline(current_config)
Step 5: Configure offline tracking for air-gapped HPC nodes
High-performance computing (HPC) compute nodes and secure laboratory environments frequently operate without outbound internet access, preventing CodeCarbon from querying external cloud metadata APIs or live grid intensity services like Electricity Maps. In offline environments, instantiate OfflineEmissionsTracker and supply the three-letter ISO country code corresponding to the physical facility:
from codecarbon import OfflineEmissionsTracker
# Initialize tracker with static regional grid intensity data
tracker = OfflineEmissionsTracker(
country_iso_code="USA",
region="california",
project_name="climate_modelling_hpc"
)
tracker.start()
run_simulation_kernel()
tracker.stop()
CodeCarbon references internal static lookup tables embedded within the library to assign appropriate grid emission factors without making external network requests.
Step 6: CLI tracking without modifying research code
When executing pre-compiled binaries, third-party executables, or existing Python scripts where modifying source code is undesirable, use the CodeCarbon command-line monitor wrapper. The double hyphen separates the monitor configuration from the target command:
codecarbon monitor --no-api --output-dir ./logs -- python train_classifier.py --epochs 100
The monitor launches your script as a subprocess, records energy draw across active hardware devices for the duration of execution, and logs the resulting dataset upon process exit.
Step 7: Granular task-level profiling within complex pipelines
In scientific computing, workloads often consist of heterogeneous phases: input/output data ingestion, CPU-bound feature extraction, GPU-accelerated model training, and model evaluation. CodeCarbon supports sub-task profiling within a single continuous tracking session using start_task() and stop_task():
from codecarbon import EmissionsTracker
tracker = EmissionsTracker(project_name="end_to_end_pipeline")
tracker.start()
# Phase 1: Data preprocessing
tracker.start_task("data_preprocessing")
dataset = preprocess_data(raw_files)
tracker.stop_task()
# Phase 2: Model training
tracker.start_task("model_training")
model = train_model(dataset)
tracker.stop_task()
# Phase 3: Inference evaluation
tracker.start_task("model_evaluation")
metrics = evaluate_test_set(model)
tracker.stop_task()
tracker.stop()
This generates distinct entries for each task segment, allowing research software engineers to identify which specific phase of an analysis pipeline represents the dominant contributor to overall energy consumption.
Output and how to read it
CodeCarbon records tracking results in a comma-separated values file named emissions.csv in the designated output directory. Each row represents a completed tracking run or flushed task interval. Understanding the provenance and mathematical definition of each column is essential for conducting rigorous scientific reporting.
The core calculation performed by CodeCarbon is expressed mathematically as:
Emissions (kg CO2eq) = Energy (kWh) × Carbon Intensity (kg CO2eq / kWh)
Energy consumption is calculated by integrating instantaneous power readings over time across all discrete sampling intervals:
Energy = Σ [ (Power_CPU + Power_GPU + Power_RAM) × Δt × PUE ]
where Power represents the instantaneous wattage drawn by each monitored hardware subsystem, Δt is the measurement interval in hours, and PUE is the Power Usage Effectiveness multiplier representing facility infrastructure overhead such as cooling and power distribution (defaulting to 1.0 when unconfigured).
The primary columns generated in emissions.csv include:
- timestamp: The ISO 8601 date and time when the tracking session concluded.
- project_name: The user-defined project identifier assigned in the tracker configuration.
- run_id: A unique UUID string identifying the specific execution instance.
- duration: The total elapsed wall-clock execution time in seconds.
- emissions: The total estimated greenhouse gas footprint expressed in kilograms of CO2 equivalent (kg CO2eq).
- emissions_rate: The rate of carbon emissions over time, calculated as emissions divided by duration (expressed in kg/s).
- cpu_power: The mean power drawn by the CPU during the tracking period, expressed in watts (W).
- gpu_power: The mean power drawn across all detected GPUs, expressed in watts (W).
- ram_power: The mean power estimated or measured for system memory, expressed in watts (W).
- cpu_energy: Total electrical energy consumed by the CPU, expressed in kilowatt-hours (kWh).
- gpu_energy: Total electrical energy consumed by the GPU subsystem, expressed in kilowatt-hours (kWh).
- ram_energy: Total electrical energy consumed by system RAM, expressed in kilowatt-hours (kWh).
- energy_consumed: The sum of cpu_energy, gpu_energy, and ram_energy in kilowatt-hours (kWh), incorporating PUE scaling.
- country_name and country_iso_code: The geographical jurisdiction identified via IP geolocation or user-configured ISO code.
- region: The specific administrative state, province, or cloud provider region where the compute infrastructure is hosted.
- cloud_provider: The detected cloud hosting service (such as aws, gcp, or azure), identified via internal cloud metadata endpoints.
- cloud_region: The specific data center deployment zone (for example, us-east-2 or europe-west1).
- cpu_count and cpu_model: The number of logical CPU threads and the processor hardware model string detected at startup.
- gpu_count and gpu_model: The quantity and model name of connected accelerator cards (for example, NVIDIA A100-SXM4-80GB).
- ram_total_size: Total installed physical memory capacity in gigabytes (GB).
- tracking_mode: Indicates whether the session operated in machine mode (measuring whole-node hardware consumption) or process mode (attributing proportional CPU usage based on process thread utilization).
When reporting results in research manuscripts, authors should report total energy_consumed in kilowatt-hours alongside final emissions in kg CO2eq, accompanied by explicit notes identifying the hardware model, duration, and whether regional or global grid intensity factors were applied. This separation of energy and emissions ensures that computational benchmarks remain comparable across geographic regions with differing grid carbon intensities.
Troubleshooting
When deploying CodeCarbon across diverse academic computing clusters and laboratory environments, research software engineers commonly encounter configuration hurdles. The following solutions resolve the most frequent operational challenges.
Resolving Linux RAPL permission errors
On modern Linux distributions, the Running Average Power Limit (RAPL) sysfs interface located at /sys/class/powercap/intel-rapl exposes detailed CPU energy counters in microjoules (energy_uj). Following upstream Linux kernel security patches designed to mitigate side-channel timing attacks, these files are restricted to root read permissions by default. When a non-root user executes CodeCarbon, the library emits a warning stating that RAPL cannot be read due to permission errors and falls back to estimating CPU power from thermal design power (TDP) and CPU load.
To enable hardware-accurate RAPL readings on dedicated research workstations without running computational code as root, configure a persistent udev rule. Create a file at /etc/udev/rules.d/99-codecarbon-rapl.rules containing:
ACTION=="add", SUBSYSTEM=="powercap", KERNEL=="intel-rapl:*", RUN+="/bin/chmod 444 %E{PATH}/energy_uj"
Reload and trigger udev rules using administrative privileges:
sudo udevadm control --reload-rules
sudo udevadm trigger
On multi-user HPC clusters where system administrators prohibit global read permissions on RAPL counters, configure CodeCarbon to operate in process mode or supply static power figures in the configuration.
Handling stale process lock files
If an experiment is forcefully terminated (for example, via SIGKILL or an interactive notebook restart) while CodeCarbon is running with multiple-instance protection enabled, a stale lock file may persist in the operating system temporary directory. Subsequent execution attempts will display the message: “Another instance of codecarbon is already running. Exiting.”
To clear the lock on Linux or macOS systems, remove the temporary lock file:
rm /tmp/.codecarbon.lock
Alternatively, set the parameter allow_multiple_runs=True in your tracker initialization or configure the environment variable CODECARBON_ALLOW_MULTIPLE_RUNS=True to permit concurrent tracking instances.
Addressing uncataloged CPU models
If CodeCarbon encounters a recently released CPU model that is not yet indexed in its internal hardware database (codecarbon/data/hardware/cpu_power.csv), it logs a warning: “We saw that you have a [CPU Model] but we don’t know it… We will use the default power consumption of X W per thread.” Under this fallback condition, CodeCarbon estimates power by multiplying an assumed per-thread wattage by the total thread count and scaling by observed CPU utilization.
To achieve accurate measurements on uncataloged chips, either enable Linux RAPL hardware counters (which bypass the TDP lookup table entirely) or specify your processor Thermal Design Power directly using the configuration parameter or by contributing the specification to the open-source hardware catalog.
GPU discovery in containerized and SLURM environments
When running inside Docker or Apptainer containers, CodeCarbon requires access to the host NVIDIA Management Library to monitor GPU wattage. If nvidia-smi is accessible within the container but CodeCarbon fails to record GPU power, verify that the container was launched with the NVIDIA Container Toolkit flag (–gpus all for Docker, or –nv for Apptainer). On SLURM clusters, ensure that CUDA_VISIBLE_DEVICES is properly populated by the resource scheduler so that CodeCarbon binds to the allocated accelerator devices.
Free alternatives
While CodeCarbon is among the most widely adopted carbon tracking libraries in research computing, several alternative open-source tools address different operational contexts, such as theoretical pre-computation estimation, predictive deep learning interruption, and cluster-wide daemon monitoring. The table below compares the primary free, open-source alternatives available to researchers.
| Tool | Primary Approach | Supported Hardware | Key Advantage | Best Operational Context |
|---|---|---|---|---|
| CodeCarbon | Real-time empirical telemetry | CPU (RAPL/EMI), GPU (NVML/AMD), RAM | Granular CSV export, sub-task profiling, and multi-cloud metadata integration | Iterative ML model development, script profiling, and manuscript reporting |
| Eco2AI | Real-time process telemetry | CPU (RAPL), GPU (NVML), RAM | Minimalist runtime footprint with strict process vs. machine power attribution | Lightweight edge computing and individual algorithmic efficiency studies |
| CarbonTracker | Empirical telemetry + predictive modeling | CPU (RAPL), GPU (NVML) | Predicts total training emissions from early epochs and can halt runaway jobs | Large-scale deep neural network training on expensive GPU clusters |
| Green Algorithms | Formula-based mathematical estimation | CPU, GPU, TPU, Memory | Zero installation required; intuitive web calculator and standardized reporting | Grant proposal estimates, paper methodology sections, and HPC budgeting |
| Scaphandre | Host-level system agent / daemon | CPU (RAPL), RAM (RAPL DRAM) | Independent Prometheus metrics exporter with zero application code modification | Kubernetes clusters, bare-metal server monitoring, and IT infrastructure audits |
Choosing among these alternatives depends on your project constraints. When preparing grant applications or budgeting compute resources prior to hardware allocation, Green Algorithms provides immediate, standardized theoretical calculations without running code. For massive deep learning workloads where training runs span several days, CarbonTracker offers proactive safety by predicting final emissions during the initial training epochs and aborting runs that exceed carbon budgets. For monitoring heterogeneous enterprise or university server fleets where modifying user scripts is impractical, Scaphandre operates as an external systems daemon exporting hardware metrics to Prometheus. However, for research software engineers seeking flexible, script-level empirical logging with sub-task attribution, CodeCarbon remains the most versatile framework.
To assist research teams in selecting appropriate tooling, the data table below compares the technical specifications, telemetry backends, sampling intervals, and regional grid calculation methods across these research computing frameworks.
Frequently asked questions
How does CodeCarbon handle computing workloads in virtual machines or Docker containers?
When running inside virtual machines or standard Docker containers, CodeCarbon cannot directly access host kernel interfaces such as Linux RAPL (/sys/class/powercap) unless the host system administrator explicitly passes through the powercap directory as a volume mount (for example, -v /sys/class/powercap:/sys/class/powercap:ro). In the absence of direct hardware counters, CodeCarbon detects the virtualization layer and falls back to estimating CPU power by multiplying the detected or generic Thermal Design Power (TDP) by average CPU utilization. For GPU monitoring in containers, pass-through is seamless provided the NVIDIA Container Toolkit (–gpus all) or Apptainer NVIDIA runtime (–nv) is enabled, allowing CodeCarbon to query NVML device counters directly.
What is the difference between machine tracking mode and process tracking mode?
CodeCarbon supports two distinct tracking modes: machine mode and process mode. Machine mode measures the total electrical power consumed by the entire physical computer, including all concurrent operating system processes, background daemons, and system overhead; it represents the most accurate hardware-grounded metric when running on a dedicated workstation or single-tenant cloud instance. In contrast, process mode attempts to estimate the specific fraction of electrical energy attributable to your Python script by calculating the ratio of CPU time consumed by your process and its children relative to total system CPU capacity. Process mode is recommended on shared multi-tenant servers, although GPU power tracking remains host-wide because hardware accelerator drivers do not expose per-process energy counters.
How can CodeCarbon be used in air-gapped or offline high-performance computing clusters?
To track emissions in air-gapped computing environments, secure enterprise enclaves, or compute nodes isolated from the public internet, use the OfflineEmissionsTracker class. By passing the parameter country_iso_code with the three-letter ISO code of the facility location (for example, “USA”, “GBR”, “DEU”, or “FRA”) and optionally the sub-national region, CodeCarbon bypasses all external network requests to geolocation APIs and cloud endpoints. Instead, it queries an internal static database of national and regional carbon intensity factors embedded directly within the package.
Does CodeCarbon account for embodied carbon and hardware manufacturing emissions?
CodeCarbon focuses exclusively on operational greenhouse gas emissions (Scope 2 emissions) resulting from the active electricity consumed by computing hardware during code execution. It does not calculate embodied carbon—the cradle-to-gate greenhouse gas emissions generated during hardware manufacturing, raw material extraction, global supply chain transportation, or end-of-life disposal. For comprehensive life cycle assessments (LCA) of computing infrastructure, researchers should supplement CodeCarbon operational telemetry with embodied carbon estimation frameworks such as ACT (Architectural Carbon Modeling) or Green Algorithms v3.
What Power Usage Effectiveness (PUE) value should researchers assign to on-premises compute facilities?
Power Usage Effectiveness (PUE) is an efficiency metric defined as the ratio of total data center facility energy (including cooling, lighting, and power distribution systems) to the energy consumed directly by computing hardware. If unconfigured, CodeCarbon assumes a baseline PUE of 1.0, representing an idealized scenario with zero auxiliary overhead. However, real-world data centers exhibit average PUE values between 1.1 and 1.6. Major hyper-scale cloud providers (such as Google Cloud, AWS, and Microsoft Azure) publish annual environmental reports documenting average fleet PUE values typically ranging from 1.10 to 1.20. For university-owned, on-premises server rooms or older department clusters, researchers should consult facility managers to determine the site-specific PUE, which frequently averages between 1.40 and 1.60, and configure the pue parameter accordingly.
Sources
- CodeCarbon Development Team. “CodeCarbon: Measure and Reduce Carbon Emissions from Computing – Official Documentation.” docs.codecarbon.io. Accessed 2026-11-16. https://docs.codecarbon.io
- Schmidt, Victor, Kamal Goyal, Aditya Joshi, Boris Feld, Liam Conell, Nikolas Laskaris, Doug Blank, Jonathan Wilson, Sorelle Friedler, and Sasha Luccioni. “CodeCarbon: Estimate and Track Carbon Emissions from Machine Learning Computing.” Zenodo, 2021. Accessed 2026-11-16. https://doi.org/10.5281/zenodo.4658425
- Lacoste, Alexandre, Alexandra Luccioni, Victor Schmidt, and Thomas Dandres. “Quantifying the Carbon Emissions of Machine Learning.” arXiv preprint arXiv:1910.09700, 2019. Accessed 2026-11-16. https://arxiv.org/abs/1910.09700
- Budenny, Semen, Vladimir Derlov, Nikita Chekalin, Aleksandr Gasnikov, and Ivan Oseledets. “Eco2AI: Carbon Emission Tracking of Machine Learning Models.” arXiv preprint arXiv:2208.00406, 2022. Accessed 2026-11-16. https://arxiv.org/abs/2208.00406
- Anthony, Lasse F. Wolff, Benjamin Kanding, and Raghavendra Selvan. “Carbontracker: Tracking and Predicting the Carbon Footprint of Training Deep Learning Models.” ICML Workshop on Challenges in Deploying and Monitoring Machine Learning Systems, 2020. Accessed 2026-11-16. https://arxiv.org/abs/2007.03051
- Lannelongue, Loïc, Jason Grealey, and Michael Inouye. “Green Algorithms: Quantifying the Carbon Footprint of Computation.” Advanced Science 8, no. 12 (2021): 2100707. Accessed 2026-11-16. https://doi.org/10.1002/advs.202100707
- Hubblo. “Scaphandre: Energy Consumption Metrology Agent.” GitHub Repository, 2024. Accessed 2026-11-16. https://github.com/hubblo-org/scaphandre
Data: Research Computing Energy and Carbon Telemetry Frameworks
Comparative technical matrix of open-source research computing energy telemetry and carbon estimation frameworks, analyzing CPU, GPU, and RAM measurement mechanisms, default telemetry sampling rates, and geographic grid intensity support.
Period covered: 2021/2026. Coverage: Global.
| Framework | Primary Runtime | CPU Telemetry Backend | GPU Telemetry Backend | RAM Accounting Method | Default Polling Interval (seconds) | Cloud Region Detection | Offline Mode Support |
|---|---|---|---|---|---|---|---|
| CodeCarbon | Python | Intel RAPL / Windows EMI / powermetrics / TDP fallback | NVIDIA NVML / AMD SMI | Modelled 5W per DIMM (x86) / PMIC rails (RPi5) | 15 | Supported (AWS, GCP, Azure) | Supported (ISO country codes) |
| Eco2AI | Python | Intel RAPL / AMD Zen RAPL sysfs | NVIDIA NVML (pynvml) | Static memory model based on capacity | 10 | Manual cloud region assignment | Supported (Static regional tables) |
| CarbonTracker | Python | Intel RAPL sysfs | NVIDIA NVML (pynvml) | Excluded from default calculation | 10 | Supported (Cloud provider mappings) | Supported (Pre-fetched intensity files) |
| Green Algorithms | Python / R / Web | TDP and core-hour mathematical modeling | TDP and accelerator runtime model | Modelled at 0.375 W per GB RAM | 0 | Supported (Major provider regions) | Supported (Local script calculations) |
| Scaphandre | Rust | Linux RAPL powercap sysfs (/sys/class/powercap) | Excluded (Host CPU and memory only) | Linux RAPL DRAM domain counters | 1 | Infrastructure agent level | Supported (Local metrics daemon) |
| Experiment Impact Tracker | Python | Intel RAPL sysfs | NVIDIA NVML (pynvml) | Modelled memory energy | 15 | Supported (Cloud region lookup) | Supported (Static fallback tables) |
Sources
- CodeCarbon Documentation: Methodology & Output Reference (accessed 2026-11-16)
- Schmidt et al., CodeCarbon: Estimate and Track Carbon Emissions from Machine Learning Computing (accessed 2026-11-16)
- Budenny et al., Eco2AI: Carbon Emission Tracking of Machine Learning Models (accessed 2026-11-16)
- Anthony et al., Carbontracker: Tracking and Predicting the Carbon Footprint of Training Deep Learning Models (accessed 2026-11-16)
- Lannelongue et al., Green Algorithms: Quantifying the Carbon Footprint of Computation (accessed 2026-11-16)
- Hubblo: Scaphandre Energy Consumption Metrology Agent (accessed 2026-11-16)
Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.







