Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more hardware info: PCI devices, graphics adapters, CPU instruction sets #1300

Open
VorpalBlade opened this issue Jul 6, 2024 · 1 comment

Comments

@VorpalBlade
Copy link

Maybe this is out of scope of this crate, but you already have some of this, such as CPU vendor and model.

I'm working on (Linux specific in my case) code that needs to:

  • Enumerate vendor of GPU(s). So an interface that exposes similar data to the lspci command. Though that uses a database mapping device IDs to names, that we would presumably have to parse in Rust. Fun. The data before lookup is all in /sys/bus/pci/devices. Even for PCI Express.
  • Determine if this is a laptop, desktop, server or VM (/sys/class/dmi/id/chassis_type on x86-64 Linux, though not always accurate or reliable).
  • I'm also interested in what CPU feature level the current CPU has (x86-64-v3 etc). For ARM/ARM64 this doesn't apply.
  • Determine if the system is BIOS, UEFI or otherwise (e.g. some ARM system with custom boot like a Raspberry Pi). You can check for existence of /sys/firmware/efi.
  • Determine if the system has a TPM. You can check for /sys/class/tpm/tpm0 (or more accurately tpm* etc)

I could implement all of these for Linux. I have no clue for other platforms (*BSD etc). And I don't even own a computer running a non-free OS (like Windows) any more.

@VorpalBlade
Copy link
Author

The PCI ID list seems to have a very simple format actually, so that should be quite easy. However, install location seems to vary:

  • /usr/share/hwdata/pci.ids on Arch Linux
  • /usr/share/misc/pci.ids on Debian and Raspbian

Don't know about distros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant