L3tum / HardwareInformation

.NET Standard Cross-Platform Hardware Information Gatherer
MIT License
56 stars 11 forks source link

Add Peripheral Detection #21

Closed CodeWithShreyans closed 3 years ago

CodeWithShreyans commented 4 years ago

Can there be detection for keyboard, mice, headphones, RGB controllers, fans, etc.?

L3tum commented 4 years ago

Yep! Though it'd be quite a bit of work, especially since I'm not sure about how well the various Linux systems will support it. Windows is easier in that regard, I may start with that.

caunt commented 3 years ago

I'd tried to get my keyboard manufacturer from WMIC (also device manager) but it just says "Standart keyboard". Assuming there will be some issues with peripherals. Also looking for any another way to get USB device manufacturer.

CodeWithShreyans commented 3 years ago

Maybe assistant applications for high-end peripherals install a special driver which has the details?

caunt commented 3 years ago

Nvm i found it in PnP device list in WMIC. Seems to be able to make USB devices list easly 😃

caunt commented 3 years ago

Get-PnPDevice | ForEach-Object { Get-PnPDeviceProperty -InstanceId $_.InstanceId | select KeyName, Data }

Seems good as it prints all PnP devices and their properties (hardwareId, manufacturer, product, etc)

L3tum commented 3 years ago

Interesting that it's available as a powershell module but not in the WMI Entity (PnPDevice). At least to my knowledge.

I'll try to find the source code for that command, maybe I can reverse engineer it. I'd like to avoid as many calls to console commands as possible (and I already dislike MacOS as a result).

caunt commented 3 years ago

I'd like to avoid as many calls to console commands as possible

And also script that I sent works only in latest versions of windows. So we should find right way to get PnP devices information.

Get-PnPDeviceProperty method was added only in windows 10.

CodeWithShreyans commented 3 years ago

All the ls... tools in Linux are an easy way to get hardware info. lsusb shows all USB devices on Linux. lsusb -v gives an extremely detailed output for the devices. lsusb -t -v shows it in a tree of which device is connected to which USB Hub. lspci gives info on pci devices. lspci -v gives verbose output and lspci -vv is even more verbose. lspci -mm and lspci -mm -v give a structured data output. lsblk -S gives info on drives.

L3tum commented 3 years ago

@caunt Good to know, that means the whole thing becomes more complicated :( Fallback would still be to access the registry, though I'd like to avoid that at all costs.

@DestroyerXyz Are the lsXXX tools guaranteed to be present on any Linux system? Afaik most docker images don't have it, for example. I'd like to be as barebones as possible.

CodeWithShreyans commented 3 years ago

Most Linux systems do have the ls... tools

L3tum commented 3 years ago

I've found a few libraries for Windows, but they all only seem to detect my Headset, not even the Xbox Controller that WMI offers, as they go directly through the USB Hub and any devices that are already in use can't be queried...or something like that. Windows seems to be more tricky than I thought. The Registry method also only found my headset and nothing else, which is worrying. I may lock it behind Win10 for now and use Get-PnpDevice, as much as it pains me.

CodeWithShreyans commented 3 years ago

I don't have many devices but I tried lsXXX on a wireless mouse and a webcam and it worked.

L3tum commented 3 years ago

The Get-PnPDevice "Source code" (as available through Powershell) can't be used. I'm not sure if something's missing or if it's obfuscated. It's apparently also part of Windows, and not Powershell, and as such isn't open source. Yay.

I'll start using this command and locking it behind Win10. Linux seems okay with the lsXXX commands. Maybe I'll do some manual /sys/ querying if I got time.

L3tum commented 3 years ago

https://github.com/L3tum/HardwareInformation/commit/6183165ecbdf0ff2ce708946cad674153cea6b02 It's so janky, I love it.

L3tum commented 3 years ago

Seems good enough for Windows for now. Unfortunately the Manufacturer doesn't seem to be available or I haven't found it yet. Maybe DriverProvider? Though that is Microsoft most of the time, so not really the Manufacturer.

I'm also not sure whether to strip the Hubs from the list. I already removed most of them, but those two seem to be my front-panel IO and the hub of my Mainboard (ASMedia for my ASUS afaik), which may be interesting to have.

Here's an example from my PC:

"UsbDevices":[{"Name":"G533 Gaming Headset","DriverName":"Logitech G533 Gaming Headset","DriverVersion":"2020.7.55435.0","DriverDate":"2020-07-17T01:00:00","Class":"MEDIA","DriverProvider":"Logitech"},{"Name":"Gaming Mouse G502","DriverName":"USB Compos
ite Device","DriverVersion":"10.0.19041.488","DriverDate":"2006-06-21T02:00:00","Class":"USB","DriverProvider":"Microsoft"},{"Name":"AURA LED Controller","DriverName":"WinUsb Device","DriverVersion":"10.0.19041.1","DriverDate":"2006-06-21T02:00:00","Class":"USBDevice","DriverProvider":"Microsoft"},{"Name
":"Gaming Keyboard G910","DriverName":"USB Composite Device","DriverVersion":"10.0.19041.488","DriverDate":"2006-06-21T02:00:00","Class":"USB","DriverProvider":"Microsoft"},{"Name":"C922 Pro Stream Webcam","DriverName":"c922 Pro Stream Webcam","DriverVersion":"1.3.89.0","DriverDate":"2018-10-24T01:00:00"
,"Class":"Image","DriverProvider":"Logitech"},{"Name":"USB","DriverName":"Disk drive","DriverVersion":"10.0.19041.1","DriverDate":"2006-06-21T02:00:00","Class":"DiskDrive","DriverProvider":"Microsoft"},{"Name":"CSR8510 A10","DriverName":"Generic Bluetooth Radio","DriverVersion":"10.0.19041.488","DriverDa
te":"2006-06-21T02:00:00","Class":"Bluetooth","DriverProvider":"Microsoft"},{"Name":"USB2.0 Hub","DriverName":"Generic USB Hub","DriverVersion":"10.0.19041.264","DriverDate":"2020-05-09T01:00:00","Class":"USB","DriverProvider":"Microsoft"},{"Name":"ASM107x","DriverName":"Generic SuperSpeed USB Hub","Driv
erVersion":"10.0.19041.264","DriverDate":"2020-05-09T01:00:00","Class":"USB","DriverProvider":"Microsoft"},{"Name":"Flash Disk","DriverName":"USB Mass Storage Device","DriverVersion":"10.0.19041.1","DriverDate":"2006-06-21T02:00:00","Class":"USB","DriverProvider":"Microsoft"},{"Name":"Expansion","DriverN
ame":"USB Attached SCSI (UAS) Mass Storage Device","DriverVersion":"10.0.19041.1","DriverDate":"2006-06-21T02:00:00","Class":"SCSIAdapter","DriverProvider":"Microsoft"},{"Name":"XBOX ACC","DriverName":"Xbox Wireless Adapter for Windows","DriverVersion":"1.0.46.1","DriverDate":"2017-07-11T01:00:00","Class
":"Net","DriverProvider":"Xbox"}
CodeWithShreyans commented 3 years ago

You can add a long list of general manufacturers and check if one of them is present in the Name or DriverName (or DriverProvider)

CodeWithShreyans commented 3 years ago

You can also search Google with the DriverName to find the manufacturer using the API (https://developers.google.com/custom-search/v1/overview) if the list way doesn't work, for ex., I searched google for "C922 Pro Webcam" and found that the Manufacturer is Logitech.

CodeWithShreyans commented 3 years ago

Another API (https://rapidapi.com/blog/lp/google-search-api/?utm_source=google&utm_medium=cpc&utm_campaign=Alpha_100831832819&utm_term=google%20search%20api_e&gclid=CjwKCAjwoc_8BRAcEiwAzJevte2kSkfNOqYRMWQrEW674Jtjb5_Z7IaiJzb2Eze-se1v60TEYpSIahoC9LkQAvD_BwE)

caunt commented 3 years ago

That's strange because I saw keyboard/mouse "manufacturer" and "product" fields on my PC with powershell script. I'll show it in a few hours.

L3tum commented 3 years ago

As far as I've understood it (which basically amounts to 2 hours of scouring MS docs yesterday), these values can, but don't need to be, set by the device and/or the driver's INI file. It'd definitely be cool to have an example so I can use these as optional values or something to that extent.

L3tum commented 3 years ago

Ah, found it. DEVPKEY_Device_Manufacturer Logitech G series. I need to walk the Device Tree to get to that. Lemme see if I can implement that.

caunt commented 3 years ago

My wrong. Now I see a lot of "DEVPKEY_Device_Manufacturer" key names in PnP device propertiers ... but all of them something like "Intel" or "Microsoft" that does not meaning anything helpful for USB device.

My keyboard/mouse have just "Standard USB Host Controller" value in that property.

caunt commented 3 years ago

Also I thought I saw any "product" property but that false.

L3tum commented 3 years ago

@DestroyerXyz and @caunt got me thinking though. I'm now using the "optional" (I guess) properties of Manufacturer and name and also do some matching on those, as well as DriverProvider, to get the best possible data.

Additionally, I've implemented a T4 Template to fetch the latest USB Vendor and Product IDs from http://www.linux-usb.org/usb.ids that are then mapped to the IDs provided in DeviceID.

I'm still gonna do some optimizations as right now those lookups take ~200ms alone on my machine and that's...not good.

Result (Don't worry about the weird spaces, those are due to copying it from the console):

{
  "UsbDevices": [
    {
      "Name": "Log itech G533 Gaming Headset",
      "BusReportedName": "G533 Gaming Headset",
      "DriverName": "Logitech G533 Gaming Headset",
      "DriverVersion": "2020.7.55435.0",
      "DriverDate": "2020-07-17T02:00:00",
      "Class": "MEDIA",
      "DriverProvider": "Logitech",
      "Manufacturer": "Logitech G series",
      "DeviceID": "USB\\VID_046D&PID_0A66\\8&2A1B065E&0&6 ",
      "VendorID": "046D",
      "ProductID": "0A66",
      "VendorName": "Logitech, Inc.",
      "ProductName": "[G533 Wireless Headset Dongle]"
    },
    {
      "Name": "USB-Verbundgerät",
      "BusReportedName": "Gaming Mouse G502",
      "DriverName": "USB Composite Device",
      "DriverVersion": "10.0.19041.488",
      "DriverDate": "2006-06-21T01:00:00",
      "Class": "USB",
      "DriverP rovider": "Microsoft",
      "Manufacturer": "(Standard-USB-Hostcontroller)",
      "DeviceID": "USB\\VID_046D&PID_C07D&MI_01\\8&39C8A24B&0&0001",
      "VendorID": "046D",
      "ProductID": "C07D",
      "VendorName": "Logitech, Inc.",
      "ProductName": "G502 Mouse"
    },
    {
      "Name": "AURA LED Controller",
      "BusReportedName": "AURA LED Controller",
      "DriverName": " WinUsb Device",
      "DriverVersion": "10.0.19041.1",
      "DriverDate": "2006-06-21T01:00:00",
      "Class": "USBDevice",
      "DriverProvider": "Microsoft",
      "Manufacturer": "WinUsb-Gerät",
      "DeviceID": "USB\\VID_0B05&PID_18F3\\9876543210",
      "VendorID": "0B05",
      "ProductID": "18F3",
      "VendorName": "ASUSTek Computer, Inc.",
      "ProductName": null
    },
    {
      "Nam e": "USB-Verbundgerät",
      "BusReportedName": "Gaming Keyboard G910",
      "DriverName": "USB Composite Device",
      "DriverVersion": "10.0.19041.488",
      "DriverDate": "2006-06-21T01:00:00",
      "Class": "USB",
      "DriverProvider": "Microsoft",
      "Manufacturer": "(Standard-USB-Hostcontroller)",
      "DeviceID": "USB\\VID_046D&PID_C32B&MI_00\\8&1378CA8 B&0&0000",
      "VendorID": "046D",
      "ProductID": "C32B",
      "VendorName": "Logitech, Inc.",
      "ProductName": "G910 Orion Spark Mechanical Keyboard"
    },
    {
      "Name": "c922 Pro Stream Webcam",
      "BusReportedName": "C922 Pro Stream Webcam",
      "DriverName": "c922 Pro Stream Webcam",
      "DriverVersion": "1.3.89.0",
      "DriverDate": "2018-10-24T01:00:00",
      " Class": "Image",
      "DriverProvider": "Logitech",
      "Manufacturer": "Logitech",
      "DeviceID": "USB\\VID_046D&PID_085C&MI_02\\A&9F8DFBE&0&0002",
      "VendorID": "046D",
      "ProductID": "085C",
      "VendorName": "Logitech, Inc.",
      "ProductName": "C922 Pro Stream Webcam"
    },
    {
      "Name": "USB",
      "BusReportedName": "USB",
      "DriverName": "Disk drive",
      "DriverV ersion": "10.0.19041.1",
      "DriverDate": "2006-06-21T01:00:00",
      "Class": "DiskDrive",
      "DriverProvider": "Microsoft",
      "Manufacturer": "(Standardlaufwerke)",
      "DeviceID": "USBSTOR\\DISK&VEN_USB\\9207070D81E78705394&0",
      "VendorID": null,
      "ProductID": null,
      "VendorName": null,
      "ProductName": null
    },
    {
      "Name": "Generic Bluetooth Radio",
      " BusReportedName": "CSR8510 A10",
      "DriverName": "Generic Bluetooth Radio",
      "DriverVersion": "10.0.19041.488",
      "DriverDate": "2006-06-21T01:00:00",
      "Class": "Bluetooth",
      "DriverProvider": "Microsoft",
      "Manufacturer": "Cambridge Silicon Radio Ltd.",
      "DeviceID": "USB\\VID_0A12&PID_0001\\8&2A1B065E&0&3",
      "VendorID": "0A12",
      "Prod uctID": "0001",
      "VendorName": "Cambridge Silicon Radio, Ltd",
      "ProductName": "Bluetooth Dongle (HCI mode)"
    },
    {
      "Name": "Generischer USB-Hub",
      "BusReportedName": "USB2.0 Hub",
      "DriverName": "Generic USB Hub",
      "DriverVersion": "10.0.19041.264",
      "DriverDate": "2020-05-09T02:00:00",
      "Class": "USB",
      "DriverProvider": "Microsoft",
      "M anufacturer": "(Standardmäßige USB-HUBs)",
      "DeviceID": "USB\\VID_05E3&PID_0610\\8&BB5A265&0&5",
      "VendorID": "05E3",
      "ProductID": "0610",
      "VendorName": "Genesys Logic, Inc.",
      "ProductName": "Hub"
    },
    {
      "Name": "Generischer USB-Hub",
      "BusReportedName": "ASM107x",
      "DriverName": "Generic USB Hub",
      "DriverVersion": "10.0.19041.264",
      " DriverDate": "2020-05-09T02:00:00",
      "Class": "USB",
      "DriverProvider": "Microsoft",
      "Manufacturer": "(Standardmäßige USB-HUBs)",
      "DeviceID": "USB\\VID_174C&PID_2074\\8&2A1B065E&0&2",
      "VendorID": "174C",
      "ProductID": "2074",
      "VendorName": "ASMedia Technology Inc.",
      "ProductName": "ASM1074 High-Speed hub"
    },
    {
      "Name": "USB-Massens peichergerät",
      "BusReportedName": "Flash Disk",
      "DriverName": "USB Mass Storage Device",
      "DriverVersion": "10.0.19041.1",
      "DriverDate": "2006-06-21T01:00:00",
      "Class": "USB",
      "DriverProvider": "Microsoft",
      "Manufacturer": "Kompatibles USB-Speichergerät",
      "DeviceID": "USB\\VID_0577&PID_5678\\9207070D81E78705394",
      "VendorID": "0577",
      "ProductID": "5678",
      "VendorName": "ELSA",
      "ProductName": null
    },
    {
      "Name": "Per USB angeschlossenes SCSI (UAS)-Massenspeichergerät",
      "BusReportedName": "Expansion",
      "DriverName": "USB Attached SCSI (UAS) Mass Storage Device",
      "DriverVersion": "10.0.19041.1",
      "DriverDate": "2006-06-21T01:00:00",
      "Class": "SCSIAdapter",
      "DriverProvider": "Microsoft",
      "Manufacturer": "Per USB angeschlossenes SCSI (UAS)-kompatibles Gerät",
      "DeviceID": "USB\\VID_0BC2&PID_2321\\MSFT30NA4BWV9F",
      "VendorID": "0BC2",
      "ProductID": "2321",
      "VendorName": "Seagate RSS LLC",
      "ProductName": "Expansion Portable"
    },
    {
      "Name": "Xbox Wireless Adapter for Windows",
      "BusRepor tedName": "XBOX ACC",
      "DriverName": "Xbox Wireless Adapter for Windows",
      "DriverVersion": "1.0.46.1",
      "DriverDate": "2017-07-11T01:00:00",
      "Class": "Net",
      "DriverProvider": "Xbox",
      "Manufacturer": "Microsoft Corporation",
      "DeviceID": "USB\\VID_045E&PID_02FE\\430683",
      "VendorID": "045E",
      "ProductID": "02FE",
      "VendorName": "Micro soft Corp.",
      "ProductName": null
    }
  ]
}
caunt commented 3 years ago

Found possible solution for windows 7: Get-WmiObject Win32_PnPEntity - output.txt (tested on virtual machine, so there no normal keyboard/mouse/etc entries)

EDITED: solution with screenshot that i deleted was not for windows 7.

caunt commented 3 years ago

Lol I realized that Win32_PnPEntity class available on both windows 10 and windows 7 (even may be lower versions). So we can focus just on that.

EDITED: Nah its available even from Windows 98 - https://www.it-visions.de/scripting/WMIReferenz.asp?C_Klasse=Win32_PnPEntity

L3tum commented 3 years ago

I've optimized the accessor quite a bit now. Funny story though, the ThreadAffinity stuff is now broken in the linked pull request (#24). No idea why, literally didn't change anything (the changes you see there was me trying to fix it). Would be cool if any of you could try out the branch to see if it's some problem with my PC or if .NET just decided to miscompile that class now.

caunt commented 3 years ago

I'll test in few hours 🙂

caunt commented 3 years ago

Branch HI-21_pnp_devices:

image https://pastebin.com/JJFZxR2h

L3tum commented 3 years ago

Thanks! Seems like my PC was just a bit...fucked yesterday. Seems to work correctly today as well.

That key being null seems interesting though, I'll need to investigate that.

caunt commented 3 years ago

Tell me if you have not this null as I am. I can make time to debug it myself.

L3tum commented 3 years ago

If you've got some time that'd be wonderful. My best guess is that it's some specific USB device that results in one of the values being null. I've already gated every key behind an is null but maybe I've missed one.

L3tum commented 3 years ago

@DestroyerXyz I've just pushed some changes to the linked PR that now implements USB information on Linux. Would you be so kind to test it out? I don't really have a Linux system on hand where I can test USB stuff on (VMs don't support that kind of passthrough easily apparently). I'm particularly interested if some of these values actually work for you; for example Class always either contains "Hub" or "Vendor Specific Class" for me.

It seems like lsusb also already reports vendorName and productName, but parsing that would be a bit of a pain so I'm going via the lookup (which uses the same list :P) and the performance difference probably won't matter.

CodeWithShreyans commented 3 years ago

Yes, I will test it in a bit.

CodeWithShreyans commented 3 years ago

I am not sure how exactly to test the app from PR. Can you tell me the steps?

L3tum commented 3 years ago

Ah, sorry. You can checkout the branch and run it with dotnet. Alternatively I could provide you with a standalone app...I think I'll do that. Maybe for the future I'll implement some sort of artifact upload from the automatic jobs

L3tum commented 3 years ago

Here is the link to a self-contained exe for Linux 64-bit.

CodeWithShreyans commented 3 years ago

Output from running as root: info: HardwareInformation.MachineInformation[0] Loading OpCodes for CPUID info: HardwareInformation.MachineInformation[0] Collecting information from CommonInformationProvider info: HardwareInformation.MachineInformation[0] Collecting information from AMDInformationProvider info: HardwareInformation.MachineInformation[0] Collecting information from IntelInformationProvider info: HardwareInformation.MachineInformation[0] Collecting information from VulkanInformationProvider fail: HardwareInformation.MachineInformation[0] First Chance System.DllNotFoundException: Unable to load shared library 'vulkan-1' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libvulkan-1: cannot open shared object file: No such file or directory at Vulkan.Interop.NativeMethods.vkCreateInstance(InstanceCreateInfo* pCreateInfo, AllocationCallbacks* pAllocator, IntPtr* pInstance) at Vulkan.Instance..ctor(InstanceCreateInfo CreateInfo, AllocationCallbacks Allocator) fail: HardwareInformation.MachineInformation[0] Exception when collecting information from VulkanInformationProvider System.DllNotFoundException: Unable to load shared library 'vulkan-1' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libvulkan-1: cannot open shared object file: No such file or directory at Vulkan.Interop.NativeMethods.vkCreateInstance(InstanceCreateInfo* pCreateInfo, AllocationCallbacks* pAllocator, IntPtr* pInstance) at Vulkan.Instance..ctor(InstanceCreateInfo CreateInfo, AllocationCallbacks Allocator) at Vulkan.Instance..ctor() at HardwareInformation.Providers.VulkanInformationProvider.Available(MachineInformation information) at HardwareInformation.MachineInformationGatherer.GatherInformation(Boolean skipClockspeedTest, Boolean invalidateCache, ILogger`1 logger) info: HardwareInformation.MachineInformation[0] Collecting information from WindowsInformationProvider info: HardwareInformation.MachineInformation[0] Collecting information from LinuxInformationProvider fail: HardwareInformation.MachineInformation[0] First Chance System.FormatException: Input string was not in a correct format. at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type) fail: HardwareInformation.MachineInformation[0] First Chance System.FormatException: Input string was not in a correct format. at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type) fail: HardwareInformation.MachineInformation[0] First Chance System.FormatException: Input string was not in a correct format. at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type) fail: HardwareInformation.MachineInformation[0] First Chance System.FormatException: Input string was not in a correct format. at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type) fail: HardwareInformation.MachineInformation[0] First Chance System.ComponentModel.Win32Exception (2): No such file or directory at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) fail: HardwareInformation.MachineInformation[0] First Chance System.ComponentModel.Win32Exception (2): No such file or directory at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) info: HardwareInformation.MachineInformation[0] Collecting information from OSXInformationProvider info: HardwareInformation.MachineInformation[0] Running post update on CommonInformationProvider info: HardwareInformation.MachineInformation[0] Running post update on AMDInformationProvider info: HardwareInformation.MachineInformation[0] Running post update on IntelInformationProvider info: HardwareInformation.MachineInformation[0] Running post update on VulkanInformationProvider fail: HardwareInformation.MachineInformation[0] First Chance System.DllNotFoundException: Unable to load shared library 'vulkan-1' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libvulkan-1: cannot open shared object file: No such file or directory at Vulkan.Interop.NativeMethods.vkCreateInstance(InstanceCreateInfo* pCreateInfo, AllocationCallbacks* pAllocator, IntPtr* pInstance) at Vulkan.Instance..ctor(InstanceCreateInfo CreateInfo, AllocationCallbacks Allocator) fail: HardwareInformation.MachineInformation[0] Exception when running post-update from VulkanInformationProvider System.DllNotFoundException: Unable to load shared library 'vulkan-1' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libvulkan-1: cannot open shared object file: No such file or directory at Vulkan.Interop.NativeMethods.vkCreateInstance(InstanceCreateInfo* pCreateInfo, AllocationCallbacks* pAllocator, IntPtr* pInstance) at Vulkan.Instance..ctor(InstanceCreateInfo CreateInfo, AllocationCallbacks Allocator) at Vulkan.Instance..ctor() at HardwareInformation.Providers.VulkanInformationProvider.Available(MachineInformation information) at HardwareInformation.MachineInformationGatherer.GatherInformation(Boolean skipClockspeedTest, Boolean invalidateCache, ILogger`1 logger) info: HardwareInformation.MachineInformation[0] Running post update on WindowsInformationProvider info: HardwareInformation.MachineInformation[0] Running post update on LinuxInformationProvider info: HardwareInformation.MachineInformation[0] Running post update on OSXInformationProvider {"OperatingSystem":{"Platform":"Unix","ServicePack":"","Version":"5.9.1.1","VersionString":"Unix 5.9.1.1"},"Platform":"Linux","Cpu":{"ExtendedFeatureFlagsF7One":"FSGSBASE, TSC_ADJ, BMI1, AVX2, SMEP, BMI2, ERMS, INVPCID, FPU_DEP, RDSEED, ADX, SMAP, INTEL_PT","ExtendedFeatureFlagsF7Two":"NONE","ExtendedFeatureFlagsF7Three":"NONE","PhysicalCores":2,"LogicalCores":4,"Nodes":1,"LogicalCoresPerNode":4,"Architecture":"X64","Caption":null,"Name":"Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz","Vendor":"GenuineIntel","Stepping":4,"Model":61,"Family":6,"Type":"Original_OEM","FeatureFlagsOne":"FPU, VME, DE, PSE, TSC, MSR, PAE, MCE, CX8, APIC, SEP, MTRR, PGE, MCA, CMOV, PAT, PSE36, CLFSH, DS, ACPI, MMX, FXSR, SSE, SSE2, SS, HTT, TM, PBE","FeatureFlagsTwo":"SSE3, PCLMULQDQ, DTES64, MONITOR, DS_CPL, VMX, EST, TM2, SSSE3, SDBG, FMA, CX16, XTPR, PDCM, PCID, SSE4_1, SSE4_2, X2APIC, MOVBE, POPCNT, TSC_DL, AES, XSAVE, OS_XSAVE, AVX, F16C, RDRND","MaxCpuIdFeatureLevel":20,"MaxCpuIdExtendedFeatureLevel":2147483656,"MaxClockSpeed":0,"NormalClockSpeed":0,"Cores":[{"Number":0,"MaxClockSpeed":0,"NormalClockSpeed":0,"ReferenceMaxClockSpeed":1,"ReferenceNormalClockSpeed":0,"ReferenceBusSpeed":1,"Node":0,"CoreId":0},{"Number":1,"MaxClockSpeed":0,"NormalClockSpeed":0,"ReferenceMaxClockSpeed":1,"ReferenceNormalClockSpeed":0,"ReferenceBusSpeed":1,"Node":0,"CoreId":0},{"Number":2,"MaxClockSpeed":0,"NormalClockSpeed":0,"ReferenceMaxClockSpeed":1,"ReferenceNormalClockSpeed":0,"ReferenceBusSpeed":1,"Node":0,"CoreId":0},{"Number":3,"MaxClockSpeed":0,"NormalClockSpeed":0,"ReferenceMaxClockSpeed":1,"ReferenceNormalClockSpeed":0,"ReferenceBusSpeed":1,"Node":0,"CoreId":0}],"AMDFeatureFlags":{"ExtendedFeatureFlagsF81One":"NONE","ExtendedFeatureFlagsF81Two":"NONE","FeatureFlagsSvm":"NONE","FeatureFlagsApm":"NONE"},"IntelFeatureFlags":{"TPMFeatureFlags":"DTS, TURBO, ARAT, PLN, ECMD, PTM","ExtendedFeatureFlagsF81One":"LAHF_LM, LZNT, PREFETCHW","ExtendedFeatureFlagsF81Two":"SYSCALL, NX, PDPE_1GB, RDTSCP, LM","FeatureFlagsApm":"RESERVED10, RESERVED19, RESERVED25, RESERVED26, RESERVED28"},"Socket":null,"Caches":[{"Level":"LEVEL1","Type":"DATA","WBINVD":true,"CoresPerCache":1,"TimesPresent":2,"Capacity":32768,"CapacityHRF":"32 KiB","Associativity":8,"LineSize":64,"Partitions":1,"Sets":64},{"Level":"LEVEL1","Type":"INSTRUCTION","WBINVD":true,"CoresPerCache":1,"TimesPresent":2,"Capacity":32768,"CapacityHRF":"32 KiB","Associativity":8,"LineSize":64,"Partitions":1,"Sets":64},{"Level":"LEVEL2","Type":"UNIFIED","WBINVD":true,"CoresPerCache":1,"TimesPresent":2,"Capacity":262144,"CapacityHRF":"256 KiB","Associativity":8,"LineSize":64,"Partitions":1,"Sets":512},{"Level":"LEVEL3","Type":"UNIFIED","WBINVD":true,"CoresPerCache":8,"TimesPresent":1,"Capacity":3145728,"CapacityHRF":"3 MiB","Associativity":12,"LineSize":64,"Partitions":1,"Sets":4096}]},"SmBios":{"BIOSVersion":"1.20","BIOSVendor":"TOSHIBA","BIOSCodename":null,"BoardVendor":"TOSHIBA","BoardName":"ZCWAA","BoardVersion":null},"RAMSticks":[],"Disks":[],"Gpus":[{"Vendor":"Intel Corporation","Description":" Intel Corporation HD Graphics 5500 (rev 09)","Caption":null,"Name":" HD Graphics 5500 (rev 09)","DriverDate":null,"DriverVersion":null,"Status":null,"Type":"UNKNOWN","SupportedVulkanApiVersion":null,"AvailableVideoMemory":0,"AvailableVideoMemoryHRF":null}],"Displays":[],"UsbDevices":[]}

CodeWithShreyans commented 3 years ago

In a file: test.txt

CodeWithShreyans commented 3 years ago

I can also do a Mac test if you want. I just installed a macOS VM. The test may be a little inaccurate because of the VM.

L3tum commented 3 years ago

Thanks! Mac is good so far, I haven't changed anything there yet. Not sure I'll support it with this (for now) as, just like everything else on the Mac, seems to be a PITA to implement.

L3tum commented 3 years ago

@caunt I think latest PR push also has fixes for the bug you encountered. Apparently I wasn't really dilligent in checking for properties of a dictionary.

L3tum commented 3 years ago

Released in 5.0.0