-
-
Notifications
You must be signed in to change notification settings - Fork 45
Use libpci to retrieve some basic PCI data #440
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
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some notes on the code :-)
@wpkelso Intel fix just landed in the code. However, I don't see nvidia gpu in the logs 🤔 |
This comment was marked as resolved.
This comment was marked as resolved.
Please, if possible, run again and paste the logs. Thank you. |
@stsdc This is in an X session: Logs
![]() |
Haha, why it shows AMD on GeForce. Yeah, for Intel also no support so far. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not tested yet, but leaved some comments.
set_pci_properties (pci_access, pci_device); | ||
name = "AMD® " + name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pesonaly I think this code would be a little bit difficult to read. It looks like as if name
is not initialized and thus it results to be just AMD@
without reading into set_pci_properties ()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what to do with it. I'm using this Interface a bit like an abstract class.
Feels like the set_pci_properties
content should be in the class constructor. But how to make it according to DRY? 🤔
gpu_view = new SystemGPUView (resources.gpu); | ||
wrapper.add (gpu_view); | ||
foreach (var gpu in resources.gpu_list) { | ||
if (gpu.name.contains ("Intel") || gpu.name.contains ("nVidia")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works though, what about using typeof?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would You do this?
I have tried if (gpu.get_type () is GPUIntel || gpu.get_type () is GPUNvidia)
, but got type check expressions not supported for compact classes, structs, and enums
Co-authored-by: Ryo Nakano <ryonakaknock3@gmail.com>
Co-authored-by: Ryo Nakano <ryonakaknock3@gmail.com>
This is an attempt at porting libpci to vapi and use it in Monitor to detect PCI devices.
Trying to make a basic example to work.