nvidia-co2
Adds gCO2eq emissions to nvidia-smi.
https://github.com/kylemcdonald/nvidia-co2
Category: Consumption
Sub Category: Computation and Communication
Last synced: about 23 hours ago
JSON representation
Repository metadata
Adds gCO2eq emissions to nvidia-smi.
- Host: GitHub
- URL: https://github.com/kylemcdonald/nvidia-co2
- Owner: kylemcdonald
- License: mit
- Created: 2020-02-16T20:16:28.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-14T05:23:47.000Z (over 4 years ago)
- Last Synced: 2025-04-17T20:38:19.177Z (11 days ago)
- Language: Python
- Size: 9.76 MB
- Stars: 118
- Watchers: 4
- Forks: 5
- Open Issues: 0
- Releases: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
readme.md
nvidia-co2
Show gCO2eq emissions information with nvidia-smi, at the top right corner. For example: 79.2gCO2eq/h or 23.76mm^2/h sea ice.
Copies code from experiment-impact-tracker for mapping geolocations to energy usage, which can be used to monitor and report on longer-running experiments.
This script doesn't take into account:
- Carbon intensity changes with time of day.
- Datacenters often have unique energy sources.
experiment-impact-tracker
tracks this information, and it can be accessed with theirscripts/lookup-cloud-region-info
. I would be happy to add this info if the script can automatically detect the provider and region, possibly from the IP address. - The state of California has more detailed information available via California ISO and this script does not use that data.
- CPU usage is only monitored if it is tracked at
/sys/class/powercap/intel-rapl
. Doing this in a hardware-independent way requires a lot more code, with some first steps inexperiment-impact-tracker
.
When running the first time at an IP address, the script will geolocate your IP address and estimate the local carbon intensity. This information will be cached between runs in /tmp/nvidia-co2-cache.(dir|bak|dat)
. The first run might take 1 second, additional runs should take 200ms.
This script won't work by default on Google Cloud because I'm using dig
to quickly get a public IP address. Permissions are also set up in a way where you would need to install it to --user
and call python -m nvidia-co2
or similar. But with a little work it could be done :)
Install
pip install git+https://github.com/kylemcdonald/nvidia-co2.git
Example
$ nvidia-co2 -m ice
Sun Feb 16 14:44:50 2020 23.76mm^2/h sea ice
+-----------------------------------------------------------------------------+
| NVIDIA-CO2 435.21 Driver Version: 435.21 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce RTX 208... Off | 00000000:05:00.0 On | N/A |
| 45% 59C P2 206W / 260W | 10975MiB / 11016MiB | 89% Default |
+-------------------------------+----------------------+----------------------+
| 1 GeForce RTX 208... Off | 00000000:09:00.0 Off | N/A |
| 26% 34C P8 19W / 260W | 166MiB / 11019MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1149 G /usr/lib/xorg/Xorg 85MiB |
| 0 1359 G /usr/bin/gnome-shell 91MiB |
| 0 21752 C ...e/kyle/anaconda3/envs/tf2gpu/bin/python 10787MiB |
| 1 21752 C ...e/kyle/anaconda3/envs/tf2gpu/bin/python 155MiB |
+-----------------------------------------------------------------------------+
Command-line options
$ nvidia-co2 --help
usage: nvidia-co2 [-h] [--mode MODE]
Show gCO2eq emissions information with nvidia-smi. Combines CPU and GPU usage.
Emissions are corrected for location using IP address geolocation.
optional arguments:
-h, --help show this help message and exit
--mode MODE, -m MODE [ice|beef|tofu|car-mph|car-kph|bulb|cfl|watt|gco2eqph]
`ice` shows how much sea ice is lost per hour due to
your emissions. `beef` and `tofu` shows how many grams
of each it takes to produce the same emissions. `car-
mph` and `car-kph` show how fast a car would have to
drive to produce the same emissions. `bulb` and `cfl`
show how many incandescent lightbulbs or CFLs are
required to use the same power. `watt` shows how many
watts used, and `gco2eqph` shows gCOeq/hour used.
(default: gco2eqph)
Owner metadata
- Name: Kyle McDonald
- Login: kylemcdonald
- Email:
- Kind: user
- Description: Artist working with code.
- Website: http://kylemcdonald.net/
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/157106?v=4
- Repositories: 274
- Last ynced at: 2024-06-11T15:53:09.502Z
- Profile URL: https://github.com/kylemcdonald
GitHub Events
Total
- Watch event: 8
Last Year
- Watch event: 8
Committers metadata
Last synced: 7 days ago
Total Commits: 13
Total Committers: 4
Avg Commits per committer: 3.25
Development Distribution Score (DDS): 0.385
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
Name | Commits | |
---|---|---|
Kyle McDonald | k****e@k****t | 8 |
Benecoder | B****l@g****m | 2 |
Jan Schlüter | j****r@o****t | 2 |
Shubham Agarwal | s****2@g****m | 1 |
Committer domains:
- ofai.at: 1
- kylemcdonald.net: 1
Issue and Pull Request metadata
Last synced: 2 days ago
Total issues: 1
Total pull requests: 4
Average time to close issues: about 1 month
Average time to close pull requests: 2 months
Total issue authors: 1
Total pull request authors: 3
Average comments per issue: 1.0
Average comments per pull request: 1.0
Merged pull request: 4
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- shubhamagarwal92 (1)
Top Pull Request Authors
- f0k (2)
- Benecoder (1)
- shubhamagarwal92 (1)
Top Issue Labels
Top Pull Request Labels
Dependencies
- geocoder *
- shapely *
Score: 6.156978985585556