{"id":20176,"name":"nvidia-co2","description":"Adds gCO2eq emissions to nvidia-smi.","url":"https://github.com/kylemcdonald/nvidia-co2","last_synced_at":"2026-04-08T14:30:21.318Z","repository":{"id":137880809,"uuid":"240959201","full_name":"kylemcdonald/nvidia-co2","owner":"kylemcdonald","description":"Adds gCO2eq emissions to nvidia-smi.","archived":false,"fork":false,"pushed_at":"2020-10-14T05:23:47.000Z","size":10229,"stargazers_count":119,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-04-03T15:50:04.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kylemcdonald.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-02-16T20:16:28.000Z","updated_at":"2026-03-30T05:41:20.000Z","dependencies_parsed_at":"2023-09-21T19:23:48.634Z","dependency_job_id":"7e32e931-5c84-492c-89c5-e7047aa78278","html_url":"https://github.com/kylemcdonald/nvidia-co2","commit_stats":{"total_commits":13,"total_committers":4,"mean_commits":3.25,"dds":0.3846153846153846,"last_synced_commit":"da725295a8af050289b987319b801275d1fd05e9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kylemcdonald/nvidia-co2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcdonald%2Fnvidia-co2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcdonald%2Fnvidia-co2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcdonald%2Fnvidia-co2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcdonald%2Fnvidia-co2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylemcdonald","download_url":"https://codeload.github.com/kylemcdonald/nvidia-co2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcdonald%2Fnvidia-co2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31436301,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T08:13:15.228Z","status":"ssl_error","status_checked_at":"2026-04-05T08:13:11.839Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"owner":{"login":"kylemcdonald","name":"Kyle McDonald","uuid":"157106","kind":"user","description":"Artist working with code.","email":"","website":"http://kylemcdonald.net/","location":null,"twitter":null,"company":null,"icon_url":"https://avatars.githubusercontent.com/u/157106?v=4","repositories_count":274,"last_synced_at":"2024-06-11T15:53:09.502Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/kylemcdonald","funding_links":[],"total_stars":11094,"followers":3590,"following":50,"created_at":"2022-11-02T21:29:11.055Z","updated_at":"2024-06-11T15:53:19.587Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylemcdonald","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylemcdonald/repositories"},"packages":[],"commits":{"id":1254163,"full_name":"kylemcdonald/nvidia-co2","default_branch":"master","total_commits":13,"total_committers":4,"total_bot_commits":0,"total_bot_committers":0,"mean_commits":3.25,"dds":0.3846153846153846,"past_year_total_commits":0,"past_year_total_committers":0,"past_year_total_bot_commits":0,"past_year_total_bot_committers":0,"past_year_mean_commits":0.0,"past_year_dds":0.0,"last_synced_at":"2026-04-05T13:01:19.151Z","last_synced_commit":"da725295a8af050289b987319b801275d1fd05e9","created_at":"2023-03-27T10:59:05.757Z","updated_at":"2026-04-05T13:01:19.084Z","committers":[{"name":"Kyle McDonald","email":"kyle@kylemcdonald.net","login":"kylemcdonald","count":8},{"name":"Jan Schlüter","email":"jan.schlueter@ofai.at","login":"f0k","count":2},{"name":"Benecoder","email":"Benedikt.heyl@googlemail.com","login":"Benecoder","count":2},{"name":"Shubham Agarwal","email":"shubhamagarwal92@gmail.com","login":"shubhamagarwal92","count":1}],"past_year_committers":[],"commits_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcdonald%2Fnvidia-co2/commits","host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-07T00:00:11.408Z","repositories_count":6211410,"commits_count":918046029,"contributors_count":35589666,"owners_count":1142640,"icon_url":"https://github.com/github.png","host_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories"}},"issues_stats":{"full_name":"kylemcdonald/nvidia-co2","html_url":"https://github.com/kylemcdonald/nvidia-co2","last_synced_at":"2026-04-01T11:00:25.738Z","status":"error","issues_count":1,"pull_requests_count":4,"avg_time_to_close_issue":3238311.0,"avg_time_to_close_pull_request":6352328.0,"issues_closed_count":1,"pull_requests_closed_count":4,"pull_request_authors_count":3,"issue_authors_count":1,"avg_comments_per_issue":1.0,"avg_comments_per_pull_request":1.0,"merged_pull_requests_count":4,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":0,"past_year_pull_requests_count":0,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":null,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":0,"past_year_pull_request_authors_count":0,"past_year_issue_authors_count":0,"past_year_avg_comments_per_issue":null,"past_year_avg_comments_per_pull_request":null,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":0,"created_at":"2023-05-09T10:35:04.171Z","updated_at":"2026-04-01T11:00:25.738Z","repository_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcdonald%2Fnvidia-co2","issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylemcdonald%2Fnvidia-co2/issues","issue_labels_count":{},"pull_request_labels_count":{},"issue_author_associations_count":{"CONTRIBUTOR":1},"pull_request_author_associations_count":{"CONTRIBUTOR":4},"issue_authors":{"shubhamagarwal92":1},"pull_request_authors":{"f0k":2,"Benecoder":1,"shubhamagarwal92":1},"host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-05T00:00:08.668Z","repositories_count":14086048,"issues_count":34447226,"pull_requests_count":112393680,"authors_count":11226035,"icon_url":"https://github.com/github.png","host_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories","owners_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/owners","authors_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors"},"past_year_issue_labels_count":{},"past_year_pull_request_labels_count":{},"past_year_issue_author_associations_count":{},"past_year_pull_request_author_associations_count":{},"past_year_issue_authors":{},"past_year_pull_request_authors":{},"maintainers":[],"active_maintainers":[]},"events":{"total":{"WatchEvent":11},"last_year":{"WatchEvent":3}},"keywords":[],"dependencies":[{"ecosystem":"pypi","filepath":"setup.py","sha":null,"kind":"manifest","created_at":"2023-09-21T19:23:45.999Z","updated_at":"2023-09-21T19:23:45.999Z","repository_link":"https://github.com/kylemcdonald/nvidia-co2/blob/master/setup.py","dependencies":[{"id":13856657871,"package_name":"shapely","ecosystem":"pypi","requirements":"*","direct":true,"kind":"runtime","optional":false},{"id":13856657872,"package_name":"geocoder","ecosystem":"pypi","requirements":"*","direct":true,"kind":"runtime","optional":false}]}],"score":6.16541785423142,"created_at":"2023-09-11T14:52:10.454Z","updated_at":"2026-04-08T14:30:21.324Z","avatar_url":"https://github.com/kylemcdonald.png","language":"Python","category":"Consumption","sub_category":"Computation and Communication","monthly_downloads":0,"total_dependent_repos":0,"total_dependent_packages":0,"readme":"# nvidia-co2\n\nShow gCO2eq emissions information with nvidia-smi, at the top right corner. For example: **79.2gCO2eq/h** or **23.76mm^2/h sea ice**.\n\nCopies code from [experiment-impact-tracker](https://github.com/Breakend/experiment-impact-tracker) for mapping geolocations to energy usage, which can be used to monitor and report on longer-running experiments.\n\nThis script doesn't take into account:\n\n- Carbon intensity changes with time of day.\n- Datacenters often have unique energy sources. `experiment-impact-tracker` tracks this information, and it can be accessed with their `scripts/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.\n- The state of California has more detailed information available via [California ISO](http://www.caiso.com/Pages/default.aspx) and this script does not use that data.\n- 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 in `experiment-impact-tracker`.\n\nWhen 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.\n\nThis 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 :)\n\n## Install\n\n`pip install git+https://github.com/kylemcdonald/nvidia-co2.git`\n\n## Example\n\n```\n$ nvidia-co2 -m ice\nSun Feb 16 14:44:50 2020                                    23.76mm^2/h sea ice\n+-----------------------------------------------------------------------------+\n| NVIDIA-CO2 435.21       Driver Version: 435.21       CUDA Version: 10.1     |\n|-------------------------------+----------------------+----------------------+\n| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |\n| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |\n|===============================+======================+======================|\n|   0  GeForce RTX 208...  Off  | 00000000:05:00.0  On |                  N/A |\n| 45%   59C    P2   206W / 260W |  10975MiB / 11016MiB |     89%      Default |\n+-------------------------------+----------------------+----------------------+\n|   1  GeForce RTX 208...  Off  | 00000000:09:00.0 Off |                  N/A |\n| 26%   34C    P8    19W / 260W |    166MiB / 11019MiB |      0%      Default |\n+-------------------------------+----------------------+----------------------+\n\n+-----------------------------------------------------------------------------+\n| Processes:                                                       GPU Memory |\n|  GPU       PID   Type   Process name                             Usage      |\n|=============================================================================|\n|    0      1149      G   /usr/lib/xorg/Xorg                            85MiB |\n|    0      1359      G   /usr/bin/gnome-shell                          91MiB |\n|    0     21752      C   ...e/kyle/anaconda3/envs/tf2gpu/bin/python 10787MiB |\n|    1     21752      C   ...e/kyle/anaconda3/envs/tf2gpu/bin/python   155MiB |\n+-----------------------------------------------------------------------------+\n```\n\n## Command-line options\n\n```\n$ nvidia-co2 --help\nusage: nvidia-co2 [-h] [--mode MODE]\n\nShow gCO2eq emissions information with nvidia-smi. Combines CPU and GPU usage.\nEmissions are corrected for location using IP address geolocation.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --mode MODE, -m MODE  [ice|beef|tofu|car-mph|car-kph|bulb|cfl|watt|gco2eqph]\n                        `ice` shows how much sea ice is lost per hour due to\n                        your emissions. `beef` and `tofu` shows how many grams\n                        of each it takes to produce the same emissions. `car-\n                        mph` and `car-kph` show how fast a car would have to\n                        drive to produce the same emissions. `bulb` and `cfl`\n                        show how many incandescent lightbulbs or CFLs are\n                        required to use the same power. `watt` shows how many\n                        watts used, and `gco2eqph` shows gCOeq/hour used.\n                        (default: gco2eqph)\n```","funding_links":[],"readme_doi_urls":[],"works":{},"citation_counts":{},"total_citations":0,"keywords_from_contributors":[],"project_url":"https://ost.ecosyste.ms/api/v1/projects/20176","html_url":"https://ost.ecosyste.ms/projects/20176"}