{"id":24426762,"url":"https://github.com/rust-nvml/nvml-wrapper","last_synced_at":"2025-12-12T14:52:02.569Z","repository":{"id":20996887,"uuid":"84038613","full_name":"rust-nvml/nvml-wrapper","owner":"rust-nvml","description":"Safe Rust wrapper for the NVIDIA Management Library","archived":false,"fork":false,"pushed_at":"2025-03-24T21:12:28.000Z","size":1251,"stargazers_count":146,"open_issues_count":14,"forks_count":38,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-02T23:42:03.835Z","etag":null,"topics":["cuda","ffi","ffi-bindings","ffi-wrapper","gpu","hardware-management","hardware-monitoring","library","monitoring","nvidia","nvml","opencl"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-nvml.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-06T06:35:17.000Z","updated_at":"2025-04-01T01:22:16.000Z","dependencies_parsed_at":"2023-12-19T05:55:25.951Z","dependency_job_id":"12023432-bc30-46a9-991f-130b7c0fc176","html_url":"https://github.com/rust-nvml/nvml-wrapper","commit_stats":{"total_commits":259,"total_committers":11,"mean_commits":"23.545454545454547","dds":0.0424710424710425,"last_synced_commit":"940354559b6131b23734a97050c929483c9b4ad0"},"previous_names":["rust-nvml/nvml-wrapper","cldfire/nvml-wrapper"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-nvml%2Fnvml-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-nvml%2Fnvml-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-nvml%2Fnvml-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-nvml%2Fnvml-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-nvml","download_url":"https://codeload.github.com/rust-nvml/nvml-wrapper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247185151,"owners_count":20897912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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"}},"keywords":["cuda","ffi","ffi-bindings","ffi-wrapper","gpu","hardware-management","hardware-monitoring","library","monitoring","nvidia","nvml","opencl"],"created_at":"2025-01-20T12:00:16.221Z","updated_at":"2025-12-12T14:52:02.523Z","avatar_url":"https://github.com/rust-nvml.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nvml-wrapper\n\n[![Docs.rs docs](https://docs.rs/nvml-wrapper/badge.svg)](https://docs.rs/nvml-wrapper)\n[![Crates.io version](https://img.shields.io/crates/v/nvml-wrapper.svg?style=flat-square)](https://crates.io/crates/nvml-wrapper)\n[![Crates.io downloads](https://img.shields.io/crates/d/nvml-wrapper.svg?style=flat-square)](https://crates.io/crates/nvml-wrapper)\n![CI](https://github.com/Cldfire/nvml-wrapper/workflows/CI/badge.svg)\n[![dependency status](https://deps.rs/repo/github/cldfire/nvml-wrapper/status.svg)](https://deps.rs/repo/github/cldfire/nvml-wrapper)\n\nA safe and ergonomic Rust wrapper for the [NVIDIA Management Library][nvml] (NVML),\na C-based programmatic interface for monitoring and managing various states within\nNVIDIA GPUs.\n\n```rust\nuse nvml_wrapper::Nvml;\n\nlet nvml = Nvml::init()?;\n// Get the first `Device` (GPU) in the system\nlet device = nvml.device_by_index(0)?;\n\nlet brand = device.brand()?; // GeForce on my system\nlet fan_speed = device.fan_speed(0)?; // Currently 17% on my system\nlet power_limit = device.enforced_power_limit()?; // 275k milliwatts on my system\nlet encoder_util = device.encoder_utilization()?; // Currently 0 on my system; Not encoding anything\nlet memory_info = device.memory_info()?; // Currently 1.63/6.37 GB used on my system\n\n// ... and there's a whole lot more you can do. Most everything in NVML is wrapped and ready to go\n```\n\n_try the [`basic_usage`](nvml-wrapper/examples/basic_usage.rs) example on your system_\n\nNVML is intended to be a platform for building 3rd-party applications, and is\nalso the underlying library for NVIDIA's nvidia-smi tool.\n\n## Usage\n\n`nvml-wrapper` builds on top of generated bindings for NVML that make use of the\n[`libloading`][libloading] crate. This means the NVML library gets loaded upon\ncalling `Nvml::init` and can return an error if NVML isn't present, making it\npossible to drop NVIDIA-related features in your code at runtime on systems that\ndon't have relevant hardware.\n\nSuccessful execution of `Nvml::init` means:\n\n* The NVML library was present on the system and able to be opened\n* The function symbol to initialize NVML was loaded and called successfully\n* An attempt has been made to load all other NVML function symbols\n\nEvery function you call thereafter will individually return an error if it couldn't\nbe loaded from the NVML library during the `Nvml::init` call.\n\nNote that it's not advised to repeatedly call `Nvml::init` as the constructor\nhas to perform all the work of loading the function symbols from the library\neach time it gets called. Instead, call `Nvml::init` once and store the resulting\n`Nvml` instance somewhere to be accessed throughout the lifetime of your program\n(perhaps in a [`once_cell`][once_cell]).\n\n## NVML Support\n\nThis wrapper is being developed against and currently supports NVML version\n11. Each new version of NVML is guaranteed to be backwards-compatible according\nto NVIDIA, so this wrapper should continue to work without issue regardless of\nNVML version bumps.\n\n### Legacy Functions\n\nSometimes there will be function-level API version bumps in new NVML releases.\nFor example:\n\n```text\nnvmlDeviceGetComputeRunningProcesses\nnvmlDeviceGetComputeRunningProcesses_v2\nnvmlDeviceGetComputeRunningProcesses_v3\n```\n\nThe older versions of the functions will generally continue to work with the\nnewer NVML releases; however, the newer function versions will not work with\nolder NVML installs.\n\nBy default this wrapper only provides access to the newest function versions.\nEnable the `legacy-functions` feature if you require the ability to call older\nfunctions.\n\n## MSRV\n\nThe Minimum Supported Rust Version is currently 1.60.0. I will not go out of my\nway to avoid bumping this.\n\n## Cargo Features\n\nThe `serde` feature can be toggled on in order to `#[derive(Serialize, Deserialize)]`\nfor every NVML data structure.\n\n#### License\n\n\u003csup\u003e\nLicensed under either of \u003ca href=\"LICENSE-APACHE\"\u003eApache License, Version\n2.0\u003c/a\u003e or \u003ca href=\"LICENSE-MIT\"\u003eMIT license\u003c/a\u003e at your option.\n\u003c/sup\u003e\n\n\u003cbr\u003e\n\n\u003csub\u003e\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in this crate by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n\u003c/sub\u003e\n\n[nvml]: https://developer.nvidia.com/nvidia-management-library-nvml\n[libloading]: https://github.com/nagisa/rust_libloading\n[once_cell]: https://docs.rs/once_cell/latest/once_cell/sync/struct.Lazy.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-nvml%2Fnvml-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-nvml%2Fnvml-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-nvml%2Fnvml-wrapper/lists"}