# Libegpu
[](https://unlicense.org)
[](https://crates.io/crates/egpu)
[](https://pypi.org/project/egpu)
**Libegpu** is a library for enumerating external GPU (eGPU) devices & enclosures.
## ✨ Features
- Enumerates PCIe-tunneled eGPU devices from AMD, NVIDIA, and Intel
- Enumerates USB-attached eGPU enclosures from Razer (e.g. the Razer Core X V2)
- Includes an `lsegpu` CLI tool for enumerating eGPU devices & enclosures
- Includes Python bindings to the Rust library (a work in progress)
- 100% free and unencumbered public domain software
## 🛠️ Prerequisites
- [Rust] 1.85+ (2024 edition) if building from source code
## ⬇️ Installation
### Installation from PyPI
```bash
pip install -U egpu
```
### Installation from Source Code
```bash
cargo install egpu
```
## 👉 Examples
### Enumerating eGPU Devices
```rust
for device in egpu::list_devices().unwrap() {
println!("{:#?}", device);
}
```
### Enumerating eGPU Enclosures
```rust
for enclosure in egpu::list_enclosures().unwrap() {
println!("{:#?}", enclosure);
}
```
## 📚 Reference
[docs.rs/egpu](https://docs.rs/egpu/)
## 👨💻 Development
```bash
git clone https://github.com/artob/libegpu.git
```
---
[](https://x.com/intent/post?url=https://github.com/artob/libegpu&text=Libegpu)
[](https://reddit.com/submit?url=https://github.com/artob/libegpu&title=Libegpu)
[](https://news.ycombinator.com/submitlink?u=https://github.com/artob/libegpu&t=Libegpu)
[](https://www.facebook.com/sharer/sharer.php?u=https://github.com/artob/libegpu)
[](https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/artob/libegpu)
[Rust]: https://rust-lang.org