-
Notifications
You must be signed in to change notification settings - Fork 52
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
[Idea] Get GPU info #107
Comments
Hey @PandaFoss! Thank you for the detailed information you've provided and the great article too 😄 If implemented correctly, I believe this is the best shot we have at correctly identifying GPU information no matter the system. If it turns out to be a lengthy implementation, then we might consider turning this into a separate crate. My suggestion is we start with Linux, it's the first one to get new features and it's where I do all my work. |
I'm a Linux user myself, so I think it's best to start there. I'm not an experienced Rust user but I'd love to contribute as much as I can. |
I'm going to start working on this, most likely in a different repository, once I have a good bit of code setup, I'll share it with you and we can commence the real work. |
Hey! It's been a while, but I've resumed my work on this feature :) pci_fetch is the library that handles fetching PCI devices and soon enough it'll also integrate with My apologies for the month long delay it took, uni's been hectic :/ |
@PandaFoss Feel free to take a look around the code if you'd like to contribute, I cleaned it up and made it a lot more library-use friendly. And here's a nice little demo 😃 output.mp4What do you think @uttarayan21? |
Incredible work. I've been pretty busy lately but as soon as I can I'll take a closer look at the code (which from what I can see is great). Thank you! |
Thanks! I wish I had the time to do it sooner, this was a great experience 😄
Great, I'd love to hear your feedback when you're free. |
Looks really cool 👍 But since you are using GPL-2.0 for pci_fetch, you might want to change that to MIT or Apache or any permissive license since GPL-2.0 requires you to license macchina under GPL-2.0 as well. |
Oh, good catch, will do! |
libmacchina v0.5.0 now integrates with aparato (previously named pci_fetch), so I'll move this issue back over to macchina so we can print the new readouts. |
I'm afraid the future won't be shipped until I can sort out the performance issues within aparato. |
What's the current status on this? I'd love to help, as I have some Rust experience. |
Hi @PowerBall253, Thanks for taking interest! aparato was originally supposed to help us determine this information, but it's been unmaintained for very long now. If you'd like to contribute, I suggest looking at other pci.ids parsers and hooking them with libmacchina, then we can add support for that readout in macchina. |
Hi, I have no experience with this but I would like to work on as I would like to have that output. I would appreciate some guidance if you can point me in the right direction. So, first I find a library which can parse |
Hey there, nice to see you again! Thanks for taking interest in this :) You could iterate over the entries in For example,
That's not a GPU, we should move on to the next PCI device (and so on and so forth). |
Ok thanks for the guidance, I'll have a look at it when I have some free time for sure and come back here if I get stuck |
You're welcome, thanks for stepping up to work on this feature. (no pressure, though) |
I have something working. Does this issue need to be moved to libmacchina first or shall I just open a PR over there? I also have some code ready for |
You can create a PR directly :) |
Since that pr has been merged to |
I'll get to that tomorrow.
Yes, the only other alternative is to point libmacchina to the git branch temporarily which you won't need to do. |
Ok cool, thank you |
this issue was created in may 2021, and I just needed this today, exactly when it is very close to being merged... feeling lucky! thank you very much for the project Macchina team, and the gpu part too @Rolv-Apneseth |
The newest commit related to this issue seems to be broken for me
|
It was working before and only the latest commit broke it? That's weird, but I'll have a look as it's just a matter of how the strings are being processed I think edit: sorry misread the first time, assuming you didn't try it before then, but yes I'll have a look |
He's using device |
Alright will do |
In that case we should rename the |
@JacobTravers Can you |
No sorry not yet, I only implemented it for Linux. I believe it would also require internet access to get |
@uttarayan21 I would really appreciate it if you reviewed PR Macchina-CLI/libmacchina#149 which adds GPU support to libmacchina for Windows. |
Works fine now 👍🏽 |
Thanks for reporting that issue @JacobTravers |
First question, where to get the information from?
I found in the pciutils repository the following:
There are many possible places to search, depending on the kernel (or operating system). But in some cases it's a matter of reading a plain text file. In order not to make the issue too long, I recommend the first part of this article. As you can see in the article, it is possible to read the vendor identifier, device identifier and class identifier.
Step two: mapping identifiers to GPUs
I quote again the previous repository, the following:
If we go through that website, we can corroborate that the GPU information (in addition to other devices that are not relevant) can be obtained from these ID's.
At first I thought that the
pci.ids
file should be downloaded regularly to keep it updated but, at least in Arch Linux, I found it in/usr/share/hwdata/pci.ids
.I'm not sure this is the best way to solve it, but I think it can work, without relying on system commands or external crates.
The text was updated successfully, but these errors were encountered: