Why software has a carbon problem

July 22, 2024, was the hottest day ever recorded, according to NASA data. The longer trend is visible in open-access climate visuals: atmospheric carbon dioxide and other greenhouse gases have climbed steadily since the industrial revolution, with consequences showing up in severe weather and record-breaking temperatures. For those building software, the question is how to keep innovating while shrinking the environmental footprint of the code we ship. One practical starting point is tooling — specifically, the open source projects developers have created to measure and reduce the carbon emitted by their applications.

Graph showing changes emerging across the climate system over the last 2,000 years, as well as significant changes that have happened since 1850.

That's the premise behind GitHub's Green Software Directory, a community-maintained list of projects whose primary purpose is greener software. The directory draws from repositories that self-identify as green software tools. Below are the most popular entries — projects with more than 250 stars — worth a look whether you're new to sustainable coding or already deep into it.

What "green software" actually means

Green software is software that emits the least carbon possible. The Green Software Foundation breaks the problem into three levers:

  • Energy efficiency: consuming the least electricity possible
  • Hardware efficiency: using the least embodied carbon possible
  • Carbon awareness: doing more work when electricity is clean and less when it's dirty

Diagram showing the three green software principles: energy efficiency, hardware efficiency, and carbon awareness.

Measurement and metrology tools

Scaphandre

Stars: 1,500+

Scaphandre is a metrology agent for electric power and energy consumption metrics. It measures the power draw of tech services and feeds that data into any monitoring or analysis toolchain.

An example dashboard built by Scaphandre that details power consumption and the top consumers.

Kepler

Stars: 1,100+

Kepler (Kubernetes-based Efficient Power Level Exporter) uses eBPF to probe performance counters and system stats, applies ML models to estimate workload energy consumption, and exports the results as Prometheus metrics. It's aimed at understanding energy use of Kubernetes components like Pods and Nodes.

Diagram of the Kepler Exporter architecture, which exposes a variety of metrics about the energy consumption of Kubernetes components such as Pods and Nodes.

Cloud Carbon Footprint

Stars: 882+

A tool for estimating energy use in kilowatt-hours and carbon emissions in metric tons of CO2e from public cloud usage.

Graphs showing examples of someone’s cloud carbon footprint.

Carbon Aware SDK

Stars: 456+

A toolset for measuring software carbon emissions, then using that information to decide when and where to run workloads for lower impact. The Green Software Foundation also maintains the Impact Framework, a separate project for modeling, measuring, simulating, and monitoring the environmental impacts of software.

Example graph that measures carbon intensity against a timeline, showing that it’s best to run software more during times when your energy is greener and the carbon intensity is lower.

CO2.js

Stars: 388+

An open source JavaScript library that estimates carbon emissions from transferring bytes over the internet. It also provides different forms of grid intensity data — including annual average and marginal figures by country — and can query the Green Web Foundation's Green Domains dataset. Related projects include grid-intensity-go for factoring carbon intensity into job scheduling decisions, the Green Cost Explorer for AWS climate-related spend analysis, and carbon.txt, which lets digital service providers prove their infrastructure runs on green electricity.

Introduction text in CO2.js’ README from their repository.

Language-specific and workload-specific estimators

Code Carbon

Stars: 1,100+

A Python package that estimates power consumption of GPU, CPU, and RAM, then applies the regional carbon intensity of wherever the compute happens. The same organization (mlco2) maintains Impact, a tool for calculating machine learning emissions specifically.

Equation showing that the sum of your hardware energy consumption is made up of GPU, CPU and RAM, which is then multiplied by your regional carbon intensity of electricity.

carbontracker

Stars: 356+

Built for the deep learning workload, carbontracker tracks and predicts the energy consumption and carbon footprint of training models.

Introduction text in carbontracker’s README from their repository.

experiment-impact-tracker

Stars: 266+

A drop-in method for tracking energy usage, carbon emissions, and compute utilization of your system without significant code changes.

Introduction text in experiment-impact-tracker’s README from their repository.

Kernel Tuner

Stars: 269+

Rather than measuring emissions, Kernel Tuner optimizes GPU applications written in mainstream languages like CUDA, HIP, OpenCL, and OpenACC — more efficient kernels mean less energy spent per result.

Overview of Kernel Tuner’s ecosystem including Kernal Launcher, Kernel Float, and Kernal Dashboard.

Reducing what you run

Kube Green

Stars: 972+

A Kubernetes add-on that automatically shuts down resources when they aren't needed. It's a simple approach to one of the biggest sources of waste in cloud-native deployments: idle infrastructure.

Graph showing increasing CPU usage, that then is turned off by Kube Green when it’s no longer in use.

Also worth checking out

Two tools from Green Coding Solutions didn't make the star threshold but fill specific gaps. Eco-CI estimates energy consumption in CI environments, and Green Metrics Tool measures energy and CO2 consumption of software via a software life cycle analysis (SLCA).

If you know of a green software repository missing from the directory, the maintainers welcome contributions — the list is meant to keep growing alongside the field.