Code Monkey home page Code Monkey logo

infoware's Introduction

Hey there! 🎉

My name is JeanHeyd Meneide. I am a Software Engineer and the Project Editor for ISO/IEC JTC1 SC22 WG14 - Programming Languages, C.

You can find me at:

Recent Posts 📋

What I Do ✍

I make the fastest things go faster, the unsafe things much safer, and the difficult things easy to do!

I specialize in ergonomic library design, performance tuning, foreign function/language interfaces, and a little bit of graphics programming. My favorite work includes programming that enables even the newest programmers to produce high-quality code that pushes them and others towards the pit of success! Occasionally, I get stuck in a Network Programming loop 💫!

I also do Diversity and Inclusivity work in the technical space, working towards making a better and more equitable environment for everyone's contributions.

Need Something Done? ✔

Please reach out to these folks if you need something done as a dedicated project!

Business Inquiries

If you need something more than that, feel free to reach out to Shepherd's Oasis! You can find them in various places, such as:

infoware's People

Contributors

arthurbiancarelli avatar asmodai avatar calebjohnston avatar demian51 avatar drakklord avatar frost-54 avatar jameskr97 avatar merwaaan avatar mfleisz avatar nabijaczleweli avatar nthirtyone avatar ryan-rsm-mckenzie avatar thephd avatar valeriob01 avatar voldien avatar zaraka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

infoware's Issues

Expose PCI vendor/device-by-id funxions to the public?

As of now we have them in iware::detail::identify_{vendor,device}(), but moving them to iware::[subsystem]::idenify_pci_{vendor,device}()/pci_{vendor,device}_id() where [subsystem] is system maybe but it's not strictly a discovery method so maybe new data? or straight up pci module? would be nice.

Cannot build with MinGW on Linux for Windows

When cross-compiling on Linux for Windows using MinGW build fails due to:

  1. "no known conversion (...) to MONITORENUMPROC" in src/system/displays/displays_windows.cpp:26:57:
[  3%] Built target infoware_pci_generator
[  5%] Built target infoware_generate_pcis
[  7%] Building CXX object CMakeFiles/infoware.dir/src/system/displays/displays_windows.cpp.obj
/home/aki/src/infoware/src/system/displays/displays_windows.cpp: In function ‘std::vector<iware::system::display_t> iware::system::displays()’:
/home/aki/src/infoware/src/system/displays/displays_windows.cpp:26:57: error: invalid user-defined conversion from ‘iware::system::displays()::<lambda(auto:1, auto:2, auto:3, auto:4)>’ to ‘MONITORENUMPROC’ {aka ‘int (__attribute__((stdcall)) *)(HMONITOR__*, HDC__*, tagRECT*, long int)’} [-fpermissive]
   26 |         EnumDisplayMonitors(bundle.desktop_dc, nullptr, [](auto, auto hdc, auto rect, auto userdata) CALLBACK -> BOOL {
      |                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   27 |         auto& bundle = *reinterpret_cast<struct bundle*>(userdata);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   28 | 
      |                                                          
   29 |         const unsigned int desktop_dpi = GetDeviceCaps(bundle.desktop_dc, LOGPIXELSX);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |         // https://blogs.msdn.microsoft.com/oldnewthing/20101013-00/?p=12543
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   31 |         const unsigned int desktop_bpp    = GetDeviceCaps(bundle.desktop_dc, BITSPIXEL) * GetDeviceCaps(bundle.desktop_dc, PLANES);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   32 |         const double desktop_refresh_rate = GetDeviceCaps(bundle.desktop_dc, VREFRESH);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   33 | 
      |                                                          
   34 | 
      |                                                          
   35 |         // Sometimes returns 0 – fall back to the desktop's globals if so.
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   36 |         const unsigned int monitor_dpi    = GetDeviceCaps(hdc, LOGPIXELSX);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 |         const unsigned int monitor_bpp    = GetDeviceCaps(hdc, BITSPIXEL) * GetDeviceCaps(hdc, PLANES);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   38 |         const double monitor_refresh_rate = GetDeviceCaps(hdc, VREFRESH);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   39 | 
      |                                                          
   40 |         const unsigned int width  = std::abs(rect->right - rect->left);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   41 |         const unsigned int height = std::abs(rect->bottom - rect->top);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   42 | 
      |                                                          
   43 |         // See http://stackoverflow.com/a/12654433/2851815 and up for DPI. In short: can't be done too too well, go with best solution.
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   44 |         bundle.ret.push_back({width, height, monitor_dpi ? monitor_dpi : desktop_dpi, monitor_bpp ? monitor_bpp : desktop_bpp,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   45 |                               monitor_refresh_rate ? monitor_refresh_rate : desktop_refresh_rate});
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   46 | 
      |                                                          
   47 |         return TRUE;
      |         ~~~~~~~~~~~~                                     
   48 |         }, reinterpret_cast<LPARAM>(&bundle));
      |         ~                                                
/home/aki/src/infoware/src/system/displays/displays_windows.cpp:26:57: note: candidate is: ‘iware::system::displays()::<lambda(auto:1, auto:2, auto:3, auto:4)>::operator BOOL (*)(auto:1, auto:2, auto:3, auto:4)() const [with auto:1 = HMONITOR__*; auto:2 = HDC__*; auto:3 = tagRECT*; auto:4 = long int; BOOL = int]’ (near match)
   26 |         EnumDisplayMonitors(bundle.desktop_dc, nullptr, [](auto, auto hdc, auto rect, auto userdata) CALLBACK -> BOOL {
      |                                                         ^
/home/aki/src/infoware/src/system/displays/displays_windows.cpp:26:57: note:   no known conversion from ‘BOOL (*)(HMONITOR__*, HDC__*, tagRECT*, long int)’ {aka ‘int (*)(HMONITOR__*, HDC__*, tagRECT*, long int)’} to ‘MONITORENUMPROC’ {aka ‘int (__attribute__((stdcall)) *)(HMONITOR__*, HDC__*, tagRECT*, long int)’}
In file included from /usr/i686-w64-mingw32/include/windows.h:72,
                 from /home/aki/src/infoware/src/system/displays/displays_windows.cpp:14:
/usr/i686-w64-mingw32/include/winuser.h:5866:90: note:   initializing argument 3 of ‘WINBOOL EnumDisplayMonitors(HDC, LPCRECT, MONITORENUMPROC, LPARAM)’
 5866 |   WINUSERAPI WINBOOL WINAPI EnumDisplayMonitors(HDC hdc,LPCRECT lprcClip,MONITORENUMPROC lpfnEnum,LPARAM dwData);
      |                                                                          ~~~~~~~~~~~~~~~~^~~~~~~~
make[2]: *** [CMakeFiles/infoware.dir/build.make:617: CMakeFiles/infoware.dir/src/system/displays/displays_windows.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:94: CMakeFiles/infoware.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
  1. Potential problems due to not being able to launch pci_generator in a correct emulation environment.
  2. Lowercase vs. Uppercase library names

Example toolchain file:

set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)

set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)

set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
set(CMAKE_MC_COMPILER ${TOOLCHAIN_PREFIX}-windmc)

Example options:

-DCMAKE_TOOLCHAIN_FILE=../tools/x86_64-w64-mingw32.cmake
-DINFOWARE_EXAMPLES=ON
-DINFOWARE_TESTS=ON
-DINFOWARE_USE_D3D=ON

GPU/GC abstraction

We need a way of finding out all relevant GPU information. This issue will be for what should theoretically be in there.

  • Vendor
  • Name / ID information
  • Thread count (WARPs or max workgroups or whatever)
  • OpenGL / D3D / Vulkan, or at least supported version?
  • Memory (size in bytes)
  • Clock Speed

Physical resolution / DPI of scaled high-DPI displays on Windows

The resolution currently detected are virtual ones after scaling and the DPI seems to be wrong, like:

# \\.\DISPLAY1
  Scale               : 100%
  Physical Reslution  : 2560 x 1440
  Logical Reslution   : 2560 x 1440
  Physical DPI        : 108.887
  Logical DPI         : 96
  Frequency           : 59
  BPP                 : 32
  Position            : 0, 0             # the primary display contains the origin (0,0) for compatibility
  Primary             : true
  Orientation         : Landscape

# \\.\DISPLAY2
  Scale               : 150%
  Physical Reslution  : 1920 x 1080
  Logical Reslution   : 1280 x 720
  Physical DPI        : 92.607
  Logical DPI         : 144
  Frequency           : 50
  BPP                 : 32
  Position            : -1920, -592
  Primary             : false
  Orientation         : Landscape

The infoware output:

    #1:
      Resolution  : 2560x1440
      DPI         : 96
      Colour depth: 32b
      Refresh rate: 59Hz
    #2:
      Resolution  : 1280x720
      DPI         : 96
      Colour depth: 32b
      Refresh rate: 50Hz

Resolution

I think it should provide the physical resolution and the scale factor instead of the (virtual) resolution, the virtual resolution will be affected by the PROCESS_DPI_AWARENESS .

The physical resolution can be got by EnumDisplaySettings function with ENUM_CURRENT_SETTINGS just like the one used in available_display_configurations().

DPI

All the DPI retrieved by GetDeviceCaps(hdc, LOGPIXELSX) in infoware for multiple displays is the system (primay display virtual) DPI, not per display.

  • < Windows 8.1 : GetDeviceCaps(hdc, LOGPIXELSX), system DPI
  • >= Windows 8.1 : GetDpiForMonitor(,MDT_EFFECTIVE_DPI,,) with SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE), per monitor DPI, but may affect the UI of the process
  • >= Windows 10, version 1607 : GetDpiForMonitor(,MDT_EFFECTIVE_DPI,,) with SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) in a thread, per monitor DPI

More information

more information required, such as scale factor, position , primary, orientation.

Debian rollup

I have a big honkin' loniax now, preliminary testing revealed:

Warnings:

nabijaczleweli@tarta:~/projects/infoware/build$ ninja
[46/48] Building CXX object CMakeFiles/infoware.dir/src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp.o
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp: In function ‘iware::cpu::cache_t iware::cpu::cache(unsigned int)’:
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:63:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:64:5: note: here
     case 'M':
     ^~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:65:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:66:5: note: here
     case 'K':
     ^~~~

E5645s have 6 cores apiece, so Physical CPUs should read 2*6=12:

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_cpu_example
Infoware version 0.2.1

  Quantities:
    Logical CPUs : 24
    Physical CPUs: 24
    CPU packages : 2

  Caches:
    L1:
      Size         : 32768B
      Line size    : 64B
      Associativity: 0
      Type         : Instruction
    L2:
      Size         : 262144B
      Line size    : 64B
      Associativity: 0
      Type         : Unified
    L3:
      Size         : 12582912B
      Line size    : 64B
      Associativity: 0
      Type         : Unified

  Architecture: x64
  Frequency: 2536104000 Hz
  Endianness: Little-Endian
  Model name: Intel(R) Xeon(R) CPU           E5645  @ 2.40GHz
  Vendor ID: GenuineIntel

  Instruction set support:
    3D-now!: false
    MMX    : true
    SSE    : true
    SSE2   : true
    SSE3   : true
    AVX    : false

No OS name (and I have a mouse connected?):

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_system_example
Infoware version 0.2.1

  Connected HIDs:
    Mice     : 1
    Keyboards: 0
    Other    : 0

  Memory:
    Physical:
      Available: 99850997760B
      Total    : 101361758208B
    Virtual:
      Available: 35184372087808B
      Total    : 35184372087808B

  Kernel:
    Variant: Linux
    Version: 4.19.0 build 6

  OS:
    Name     :
    Full name:
    Version  : 0.0.0 build 0

  Displays:
    None connected or no detection method enabled

  Display configurations:
    No displays connected, no detection method enabled, or not supported

There should be robust backend selection for GPU detection

Right now infoware is supporting multiple ways how to detect GPU, but on the Linux platform, many of them can fail. Vulkan can fail if the device is too old, on the other hand, OpenGL can fail on the opposite problem.

My problem is only one of them gets compiled into the resulting library.

I propose some kind of robust GPU detection that uses multiple backends, the priority table stated in Readme.md should be respected, but if for example, Vulkan detection fails (because vkCreateInstance or whatever vulkan related function fails) infoware would try to proceed to another detection in the priority table.

this will require device_properties() function to either throw an exception or return an error through the function parameter.

Linux OpenGL GPU detection didn't detected anything, OpenCL works

If compiled with OpenGL support and example, the infoware_gpu_example returns this

Infoware version 0.6.0

  Properties:
    No detection methods enabled

When compile with OpenCL, the GPU is correctly detected:

Infoware version 0.6.0

  Properties:
    Device #1:
      Vendor       : AMD
      Name         : gfx1031
      RAM size     : 12868124672B
      Cache size   : 16384B
      Max frequency: 2880000000Hz

There should be at least a mention in the ReadMe that OpenCL is preferred because I noticed this issue after months of use, when I found out all my Linux devices didn't report their GPU info.

clang on Windows doesn't build

P:\C++\Utilities\infoware\build_c>ninja -j100
[9/10] Building CXX object CMakeFiles/infoware.dir/src/detail/cpuid_windows.cpp.obj
FAILED: CMakeFiles/infoware.dir/src/detail/cpuid_windows.cpp.obj
D:\Programy\Programowanie\sccache\release\sccache.exe  clang++ --target=x86_64-w64-windows-gnu  -DINFOWARE_VERSION=\"0.3.1\" -I. -I../include -pedantic -Wall -Wextra -pipe -march=native -std=c++14 -MD -MT CMakeFiles/infoware.dir/src/detail/cpuid_windows.cpp.obj -MF CMakeFiles\infoware.dir\src\detail\cpuid_windows.cpp.obj.d -o CMakeFiles/infoware.dir/src/detail/cpuid_windows.cpp.obj -c ../src/detail/cpuid_windows.cpp
../src/detail/cpuid_windows.cpp:26:9: error: '__builtin_ia32_xgetbv' needs target feature xsave
 return __builtin_ia32_xgetbv((long long)(x));
        ^
1 error generated.
ninja: build stopped: subcommand failed.

Debian rollup

I have a big honkin' loniax now, preliminary testing revealed:

Warnings:

nabijaczleweli@tarta:~/projects/infoware/build$ ninja
[46/48] Building CXX object CMakeFiles/infoware.dir/src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp.o
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp: In function ‘iware::cpu::cache_t iware::cpu::cache(unsigned int)’:
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:63:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:64:5: note: here
     case 'M':
     ^~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:65:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:66:5: note: here
     case 'K':
     ^~~~

E5645s have 6 cores apiece, so Physical CPUs should read 2*6=12:

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_cpu_example
Infoware version 0.2.1

  Quantities:
    Logical CPUs : 24
    Physical CPUs: 24
    CPU packages : 2

  Caches:
    L1:
      Size         : 32768B
      Line size    : 64B
      Associativity: 0
      Type         : Instruction
    L2:
      Size         : 262144B
      Line size    : 64B
      Associativity: 0
      Type         : Unified
    L3:
      Size         : 12582912B
      Line size    : 64B
      Associativity: 0
      Type         : Unified

  Architecture: x64
  Frequency: 2536104000 Hz
  Endianness: Little-Endian
  Model name: Intel(R) Xeon(R) CPU           E5645  @ 2.40GHz
  Vendor ID: GenuineIntel

  Instruction set support:
    3D-now!: false
    MMX    : true
    SSE    : true
    SSE2   : true
    SSE3   : true
    AVX    : false

No OS name (and I have a mouse connected?):

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_system_example
Infoware version 0.2.1

  Connected HIDs:
    Mice     : 1
    Keyboards: 0
    Other    : 0

  Memory:
    Physical:
      Available: 99850997760B
      Total    : 101361758208B
    Virtual:
      Available: 35184372087808B
      Total    : 35184372087808B

  Kernel:
    Variant: Linux
    Version: 4.19.0 build 6

  OS:
    Name     :
    Full name:
    Version  : 0.0.0 build 0

  Displays:
    None connected or no detection method enabled

  Display configurations:
    No displays connected, no detection method enabled, or not supported

Info about the system, disks and a lot others

Hi, was thinking if getting info on Disks, VM's etc. was ever planned or in the works.
Specifically looking for something similar to systeminformation

AFAIK that is the most complete info collection tool out there, and if that is done in Node.js. I think all that is definitely possible with C++.

Zero values for non-primary displays on Windows

My secondary display was showing a resolution of 0x1080 rather than 1920x1080, as it's to the left of the primary display (thus has a left value of -1920, and a right value of 0).

The fix is to simply compute the width and height of the display's rect and run it past abs to be ultra pedantic.

I have not tested this fix on all possible display configurations.

PR: #43

Unsplit examples

From individual functions to individual segments.

When: when all branches are merged into master, because a lot of files will be touched/removed/created in process and that ain't no fun.

ARM support

I currently try to compile infoware on aarch64. But on all tried distribution the <cpuid.h> is missing. (debain for arm, raspberry OS)
In this source the header is referenced. Is there a possibility to add support for aarch64?

TravisCI and Appveyor

Both projects are starting to wind down open source support so it's time to find other alternatives.

And by other alternatives I mean GITHUB ACTIONS BAYBEEE.

Debian rollup

I have a big honkin' loniax now, preliminary testing revealed:

Warnings:

nabijaczleweli@tarta:~/projects/infoware/build$ ninja
[46/48] Building CXX object CMakeFiles/infoware.dir/src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp.o
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp: In function ‘iware::cpu::cache_t iware::cpu::cache(unsigned int)’:
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:63:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:64:5: note: here
     case 'M':
     ^~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:65:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:66:5: note: here
     case 'K':
     ^~~~

E5645s have 6 cores apiece, so Physical CPUs should read 2*6=12:

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_cpu_example
Infoware version 0.2.1

  Quantities:
    Logical CPUs : 24
    Physical CPUs: 24
    CPU packages : 2

  Caches:
    L1:
      Size         : 32768B
      Line size    : 64B
      Associativity: 0
      Type         : Instruction
    L2:
      Size         : 262144B
      Line size    : 64B
      Associativity: 0
      Type         : Unified
    L3:
      Size         : 12582912B
      Line size    : 64B
      Associativity: 0
      Type         : Unified

  Architecture: x64
  Frequency: 2536104000 Hz
  Endianness: Little-Endian
  Model name: Intel(R) Xeon(R) CPU           E5645  @ 2.40GHz
  Vendor ID: GenuineIntel

  Instruction set support:
    3D-now!: false
    MMX    : true
    SSE    : true
    SSE2   : true
    SSE3   : true
    AVX    : false

No OS name (and I have a mouse connected?):

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_system_example
Infoware version 0.2.1

  Connected HIDs:
    Mice     : 1
    Keyboards: 0
    Other    : 0

  Memory:
    Physical:
      Available: 99850997760B
      Total    : 101361758208B
    Virtual:
      Available: 35184372087808B
      Total    : 35184372087808B

  Kernel:
    Variant: Linux
    Version: 4.19.0 build 6

  OS:
    Name     :
    Full name:
    Version  : 0.0.0 build 0

  Displays:
    None connected or no detection method enabled

  Display configurations:
    No displays connected, no detection method enabled, or not supported

How to include in CMakeLists.txt

Unfortunately we do not know the lib name that infoware uses when included via VCPKG in a CMakeLists.txt:

works and is found

find_package (infoware CONFIG REQUIRED)

Both do not work

target_link_libraries (
infoware
iware:inforware

Can you tell us how the library name is here?

Thank you and kind regards
Philipp

Bebian problem rollup

I have a big honkin' loniax now, preliminary testing revealed:

Warnings:

nabijaczleweli@tarta:~/projects/infoware/build$ ninja
[46/48] Building CXX object CMakeFiles/infoware.dir/src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp.o
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp: In function ‘iware::cpu::cache_t iware::cpu::cache(unsigned int)’:
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:63:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:64:5: note: here
     case 'M':
     ^~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:65:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:66:5: note: here
     case 'K':
     ^~~~

E5645s have 6 cores apiece, so Physical CPUs should read 2*6=12:

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_cpu_example
Infoware version 0.2.1

  Quantities:
    Logical CPUs : 24
    Physical CPUs: 24
    CPU packages : 2

  Caches:
    L1:
      Size         : 32768B
      Line size    : 64B
      Associativity: 0
      Type         : Instruction
    L2:
      Size         : 262144B
      Line size    : 64B
      Associativity: 0
      Type         : Unified
    L3:
      Size         : 12582912B
      Line size    : 64B
      Associativity: 0
      Type         : Unified

  Architecture: x64
  Frequency: 2536104000 Hz
  Endianness: Little-Endian
  Model name: Intel(R) Xeon(R) CPU           E5645  @ 2.40GHz
  Vendor ID: GenuineIntel

  Instruction set support:
    3D-now!: false
    MMX    : true
    SSE    : true
    SSE2   : true
    SSE3   : true
    AVX    : false

No OS name (and I have a mouse connected?):

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_system_example
Infoware version 0.2.1

  Connected HIDs:
    Mice     : 1
    Keyboards: 0
    Other    : 0

  Memory:
    Physical:
      Available: 99850997760B
      Total    : 101361758208B
    Virtual:
      Available: 35184372087808B
      Total    : 35184372087808B

  Kernel:
    Variant: Linux
    Version: 4.19.0 build 6

  OS:
    Name     :
    Full name:
    Version  : 0.0.0 build 0

  Displays:
    None connected or no detection method enabled

  Display configurations:
    No displays connected, no detection method enabled, or not supported

Windows OS full name?

p:\C++\Utilities\infoware>build\bin\infoware_system_example.exe
Infoware version 0.2.1

  OS:
    Name     : Windows NT
    Full name:
    Version  : 10.0.14393 build 0
[...]

segfault on example "cpu"

  Quantities:
    Logical CPUs : 8
    Physical CPUs: 0
    CPU packages : 0

  Caches:
    L1:
      Size         : 0B
      Line size    : 0B
      Associativity: 0
      Type         : Unified
    L2:
      Size         : 0B
      Line size    : 0B
      Associativity: 0
      Type         : Unified
    L3:
      Size         : 0B
      Line size    : 0B
      Associativity: 0
      Type         : Unified

  Architecture: x64
  Frequency: 0 Hz
  Endianness: Little-Endian
Segmentation fault: 11

Done on a 2015 15" MacbookPro with 2.2 GHz Core i7 4770HQ cpu.

Visual Studio solution build fails

First it requires me to retarget solution.
Afterwards building examples & generator projects fails with these errors:

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol "struct iware::cpu::quantities_t __cdecl iware::cpu::quantities(void)" (?quantities@cpu@iware@@YA?AUquantities_t@12@XZ) referenced in function main	examples	E:\infoware\infoware\cpu.obj	1	
Error	LNK1120	5 unresolved externals	examples	E:\infoware\infoware\x64\Debug\examples.exe	1	
Error	C1083	Cannot open source file: 'pci_generator\src\pci_generator.cpp': No such file or directory	generator	E:\infoware\infoware\c1xx	1	
Warning	MSB8028	The intermediate directory (x64\Debug\) contains files shared from another project (generator.vcxproj).  This can lead to incorrect clean and rebuild behavior.	infoware	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets	392	
Warning	MSB8028	The intermediate directory (x64\Debug\) contains files shared from another project (generator.vcxproj, infoware.vcxproj).  This can lead to incorrect clean and rebuild behavior.	examples	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets	392	
Warning	MSB8028	The intermediate directory (x64\Debug\) contains files shared from another project (infoware.vcxproj).  This can lead to incorrect clean and rebuild behavior.	generator	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets	392	
Warning	MSB8027	Two or more files with the name of non-windows.cpp will produce outputs to the same location. This can lead to an incorrect build result.  The files involved are src\cpu\vendor_model_name\non-windows.cpp, src\system\amounts\non-windows.cpp, src\system\kernel_info\non-windows.cpp, src\system\memory\non-windows.cpp, src\system\OS_info\non-windows.cpp.	infoware	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets	936	
Warning	MSB8027	Two or more files with the name of non_windows.cpp will produce outputs to the same location. This can lead to an incorrect build result.  The files involved are src\cpu\architecture\non_windows.cpp, src\cpu\frequency\non_windows.cpp, src\cpu\instuction_set\non_windows.cpp, src\cpu\quantities_cache\non_windows.cpp.	infoware	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets	936	
Warning	MSB8027	Two or more files with the name of windows.cpp will produce outputs to the same location. This can lead to an incorrect build result.  The files involved are src\cpu\architecture\windows.cpp, src\cpu\frequency\windows.cpp, src\cpu\instuction_set\windows.cpp, src\cpu\quantities_cache\windows.cpp, src\cpu\vendor_model_name\windows.cpp, src\system\amounts\windows.cpp, src\system\displays\windows.cpp, src\system\kernel_info\windows.cpp, src\system\memory\windows.cpp, src\system\OS_info\windows.cpp.	infoware	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets	936	
Error	LNK2019	unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl iware::cpu::model_name(void)" (?model_name@cpu@iware@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function main	examples	E:\infoware\infoware\cpu.obj	1	
Error	LNK2019	unresolved external symbol "enum iware::cpu::architecture_t __cdecl iware::cpu::architecture(void)" (?architecture@cpu@iware@@YA?AW4architecture_t@12@XZ) referenced in function main	examples	E:\infoware\infoware\cpu.obj	1	
Error	LNK2019	unresolved external symbol "struct iware::cpu::cache_t __cdecl iware::cpu::cache(unsigned int)" (?cache@cpu@iware@@YA?AUcache_t@12@I@Z) referenced in function main	examples	E:\infoware\infoware\cpu.obj	1	
Error	LNK2019	unresolved external symbol "__int64 __cdecl iware::cpu::frequency(void)" (?frequency@cpu@iware@@YA_JXZ) referenced in function main	examples	E:\infoware\infoware\cpu.obj	1	

Debian rollup

I have a big honkin' loniax now, preliminary testing revealed:

Warnings:

nabijaczleweli@tarta:~/projects/infoware/build$ ninja
[46/48] Building CXX object CMakeFiles/infoware.dir/src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp.o
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp: In function ‘iware::cpu::cache_t iware::cpu::cache(unsigned int)’:
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:63:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:64:5: note: here
     case 'M':
     ^~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:65:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:66:5: note: here
     case 'K':
     ^~~~

E5645s have 6 cores apiece, so Physical CPUs should read 2*6=12:

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_cpu_example
Infoware version 0.2.1

  Quantities:
    Logical CPUs : 24
    Physical CPUs: 24
    CPU packages : 2

  Caches:
    L1:
      Size         : 32768B
      Line size    : 64B
      Associativity: 0
      Type         : Instruction
    L2:
      Size         : 262144B
      Line size    : 64B
      Associativity: 0
      Type         : Unified
    L3:
      Size         : 12582912B
      Line size    : 64B
      Associativity: 0
      Type         : Unified

  Architecture: x64
  Frequency: 2536104000 Hz
  Endianness: Little-Endian
  Model name: Intel(R) Xeon(R) CPU           E5645  @ 2.40GHz
  Vendor ID: GenuineIntel

  Instruction set support:
    3D-now!: false
    MMX    : true
    SSE    : true
    SSE2   : true
    SSE3   : true
    AVX    : false

No OS name (and I have a mouse connected?):

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_system_example
Infoware version 0.2.1

  Connected HIDs:
    Mice     : 1
    Keyboards: 0
    Other    : 0

  Memory:
    Physical:
      Available: 99850997760B
      Total    : 101361758208B
    Virtual:
      Available: 35184372087808B
      Total    : 35184372087808B

  Kernel:
    Variant: Linux
    Version: 4.19.0 build 6

  OS:
    Name     :
    Full name:
    Version  : 0.0.0 build 0

  Displays:
    None connected or no detection method enabled

  Display configurations:
    No displays connected, no detection method enabled, or not supported

Linux & gcc bug

In system.hpp during compilation we get this error:

/usr/local/include/infoware/system.hpp:32:4: error: expected identifier before numeric constant
   32 |    linux,
      |    ^~~~~
/usr/local/include/infoware/system.hpp:32:4: error: expected '}' before numeric constant

It probably happens because on Linux gcc defines "linux" pre-processor definition, so the easiest way for me to "fix" it was to #undef linux before.

OS_Info.full_name on MacOS

OS_Info.full_name on MacOS gives me information about the kernel (basically uname -a).

On Linux it gives information (name and version) about the distribution, and that looks more coherent.

Shouldn't the MacOS version do something similar, like the output of the sw_vers command?

The GPU 1050 Ti name is GP107?

See the figure below:
_20180422160145

ther software displays:
_20180422160202

I hope to be updated. Thank you very much.

Maybe I misunderstood the description. The above two pictures are other computers. The picture below is my computer.

My notebook display is correct. Why?
_20180422160628

vcpkg install infoware doesn't get the detail includes

Got infoware through vcpkg, installed fine. Added to my cmake lists, also ok. Tried to include - compile time errors: Cannot open include file: 'infoware/detail/linkage.hpp': No such file or directory (...).

Looked into vcpkg/packages/infoware_x64-windows/include/infoware, and yeah, there's no detail folder in there.

System abstraction

We need a way of finding out more overarching system information not directly related to the internal hardware. May include:

  • OS Vendor / Information (Ubuntu, Windows 10, etc.) (Probably going to need a versioning structure for these things too)
  • Kernel Information (Linux, Vista, whatever the fuck is inside Mac OSX)
  • Monitor/Display Count (kind've stretch, but would be nice, can also include extra information like 'High DPI' and what not)
  • Memory (size in bytes)

Fancy:

  • # of mice
  • # of keyboards

I got an actual machine and there's Debian on it, here's what's wrong

I have a big honkin' loniax now, preliminary testing revealed:

Warnings:

nabijaczleweli@tarta:~/projects/infoware/build$ ninja
[46/48] Building CXX object CMakeFiles/infoware.dir/src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp.o
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp: In function ‘iware::cpu::cache_t iware::cpu::cache(unsigned int)’:
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:63:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:64:5: note: here
     case 'M':
     ^~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:65:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:66:5: note: here
     case 'K':
     ^~~~

E5645s have 6 cores apiece, so Physical CPUs should read 2*6=12:

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_cpu_example
Infoware version 0.2.1

  Quantities:
    Logical CPUs : 24
    Physical CPUs: 24
    CPU packages : 2

  Caches:
    L1:
      Size         : 32768B
      Line size    : 64B
      Associativity: 0
      Type         : Instruction
    L2:
      Size         : 262144B
      Line size    : 64B
      Associativity: 0
      Type         : Unified
    L3:
      Size         : 12582912B
      Line size    : 64B
      Associativity: 0
      Type         : Unified

  Architecture: x64
  Frequency: 2536104000 Hz
  Endianness: Little-Endian
  Model name: Intel(R) Xeon(R) CPU           E5645  @ 2.40GHz
  Vendor ID: GenuineIntel

  Instruction set support:
    3D-now!: false
    MMX    : true
    SSE    : true
    SSE2   : true
    SSE3   : true
    AVX    : false

No OS name (and I have a mouse connected?):

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_system_example
Infoware version 0.2.1

  Connected HIDs:
    Mice     : 1
    Keyboards: 0
    Other    : 0

  Memory:
    Physical:
      Available: 99850997760B
      Total    : 101361758208B
    Virtual:
      Available: 35184372087808B
      Total    : 35184372087808B

  Kernel:
    Variant: Linux
    Version: 4.19.0 build 6

  OS:
    Name     :
    Full name:
    Version  : 0.0.0 build 0

  Displays:
    None connected or no detection method enabled

  Display configurations:
    No displays connected, no detection method enabled, or not supported

unresolved external symbol const iware::version

Compiled with Visual Studio 2017 , when I compile whole project with examples .. everything is ok.
When compile shared library (with DLL) , and include in my project .. get this error : unresolved external symbol const iware::version
All other interfaces are working fine.

Handle Macs' CPUs better

#11 happened because the Mac the author was using didn't have /proc/cpuinfo – there should probably be either (a) an alt name for /proc/cpuinfo or (b) some other way of getting that data out of Macs.

rollup

I have a big honkin' loniax now, preliminary testing revealed:

Warnings:

nabijaczleweli@tarta:~/projects/infoware/build$ ninja
[46/48] Building CXX object CMakeFiles/infoware.dir/src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp.o
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp: In function ‘iware::cpu::cache_t iware::cpu::cache(unsigned int)’:
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:63:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:64:5: note: here
     case 'M':
     ^~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:65:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:66:5: note: here
     case 'K':
     ^~~~

E5645s have 6 cores apiece, so Physical CPUs should read 2*6=12:

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_cpu_example
Infoware version 0.2.1

  Quantities:
    Logical CPUs : 24
    Physical CPUs: 24
    CPU packages : 2

  Caches:
    L1:
      Size         : 32768B
      Line size    : 64B
      Associativity: 0
      Type         : Instruction
    L2:
      Size         : 262144B
      Line size    : 64B
      Associativity: 0
      Type         : Unified
    L3:
      Size         : 12582912B
      Line size    : 64B
      Associativity: 0
      Type         : Unified

  Architecture: x64
  Frequency: 2536104000 Hz
  Endianness: Little-Endian
  Model name: Intel(R) Xeon(R) CPU           E5645  @ 2.40GHz
  Vendor ID: GenuineIntel

  Instruction set support:
    3D-now!: false
    MMX    : true
    SSE    : true
    SSE2   : true
    SSE3   : true
    AVX    : false

No OS name (and I have a mouse connected?):

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_system_example
Infoware version 0.2.1

  Connected HIDs:
    Mice     : 1
    Keyboards: 0
    Other    : 0

  Memory:
    Physical:
      Available: 99850997760B
      Total    : 101361758208B
    Virtual:
      Available: 35184372087808B
      Total    : 35184372087808B

  Kernel:
    Variant: Linux
    Version: 4.19.0 build 6

  OS:
    Name     :
    Full name:
    Version  : 0.0.0 build 0

  Displays:
    None connected or no detection method enabled

  Display configurations:
    No displays connected, no detection method enabled, or not supported

Debian rollup

I have a big honkin' loniax now, preliminary testing revealed:

Warnings:

nabijaczleweli@tarta:~/projects/infoware/build$ ninja
[46/48] Building CXX object CMakeFiles/infoware.dir/src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp.o
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp: In function ‘iware::cpu::cache_t iware::cpu::cache(unsigned int)’:
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:63:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:64:5: note: here
     case 'M':
     ^~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:65:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret.size *= 1024;
      ~~~~~~~~~^~~~~~~
../src/cpu/quantities_cache/quantities_cache_non_windows_non_darwin.cpp:66:5: note: here
     case 'K':
     ^~~~

E5645s have 6 cores apiece, so Physical CPUs should read 2*6=12:

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_cpu_example
Infoware version 0.2.1

  Quantities:
    Logical CPUs : 24
    Physical CPUs: 24
    CPU packages : 2

  Caches:
    L1:
      Size         : 32768B
      Line size    : 64B
      Associativity: 0
      Type         : Instruction
    L2:
      Size         : 262144B
      Line size    : 64B
      Associativity: 0
      Type         : Unified
    L3:
      Size         : 12582912B
      Line size    : 64B
      Associativity: 0
      Type         : Unified

  Architecture: x64
  Frequency: 2536104000 Hz
  Endianness: Little-Endian
  Model name: Intel(R) Xeon(R) CPU           E5645  @ 2.40GHz
  Vendor ID: GenuineIntel

  Instruction set support:
    3D-now!: false
    MMX    : true
    SSE    : true
    SSE2   : true
    SSE3   : true
    AVX    : false

No OS name (and I have a mouse connected?):

nabijaczleweli@tarta:~/projects/infoware/build$ ./bin/infoware_system_example
Infoware version 0.2.1

  Connected HIDs:
    Mice     : 1
    Keyboards: 0
    Other    : 0

  Memory:
    Physical:
      Available: 99850997760B
      Total    : 101361758208B
    Virtual:
      Available: 35184372087808B
      Total    : 35184372087808B

  Kernel:
    Variant: Linux
    Version: 4.19.0 build 6

  OS:
    Name     :
    Full name:
    Version  : 0.0.0 build 0

  Displays:
    None connected or no detection method enabled

  Display configurations:
    No displays connected, no detection method enabled, or not supported

std::wstring names

non-english output may look like this
image
it would be nice to get localized text

Incorrect refresh-rate with multiple displays (Windows 10, 11)

The refresh rate of the displays is the same as the first.

for (int i = 0; i < iware::system::displays().size(); i++)
{
       std::cout << "Screen [" << i + 1 << "]: " << iware::system::displays()[i].width << "x" << iware::system::displays()[i].height << " (" << iware::system::displays()[i].refresh_rate << "Hz)" << std::endl;
}

image

CPU Frequency on Windows is bogus

The windows implementation of iware::cpu::frequency does basically QueryPerformanceFrequency() * 1000 -- which returns completely bogus values.
On my machine, QueryPerformanceFrequency returns e.g. 10 MHz, so this reports 10 GHz...

Finding accurate values may be hard, but would it be preferable to return a guesstimate from HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\~MHz (e.g. 3696 on my machine)?

CPU abstraction

We need a way of finding out all relevant CPU information. This issue will be for what should theoretically be in there.

  • Physical Core Count (e.g., physical cores vs. 'Hyper-Threaded' cores)
  • Hardware Concurrency count (e.g., physical cores vs. 'Hyper-Threaded' cores)
  • Current Clock Speed
  • Min/Max Clock Speeds
  • Model Name
  • Top-Level Vendor Enumeration? (Intel, AMD, Qualcomm...? Just leave it a string, is probably a better idea)
  • Endianness (Generally Little, except or PowerPC-based archs (Big Endian, see XBox 360))
  • Instruction Set
  • Architecture
  • Caches

Device classes handling

@ThePhD had some special handling for device classes (in so many words):

# Syntax:
# C class    class_name
#    subclass    subclass_name          <-- single tab
#        prog-if  prog-if_name      <-- two tabs

et al., but it's really inconsistent with everything else.

I've for now copied the special handling as-was, but I'm pretty sure we should either (a) bail once we get to that part, or (b) handle them differently.

Why is INFOWARE_GENERATED_PCI_INDICES not defined?

I can't build all because this macro isn't defined apparently, but why? That's why then I get this linker error:
LINK : fatal error LNK1104: cannot open file 'lib\Debug\infowared.lib'

Latest version of infoware
MSVC2019
Windows10

3>C:\GitHub\infoware\src\pci.cpp(38,34): error C2065: 'INFOWARE_GENERATED_PCI_INDICES': undeclared identifier
3>C:\GitHub\infoware\src\pci.cpp(39,42): error C2065: 'INFOWARE_GENERATED_PCI_VENDORS': undeclared identifier
3>C:\GitHub\infoware\src\pci.cpp(40,42): error C2065: 'INFOWARE_GENERATED_PCI_DEVICES': undeclared identifier

Windows full_name is empty due to the COM library being already initialized

Hi,

In our project, the full_name returned by iware::system::OS_info() is empty on Windows.

It seems to be related to this line where the query is aborted if some COM initialization fails.

In our case, the CoInitializeEx call returns a negative value because the library seems to be already loaded with another mode (actual return value: RPC_E_CHANGED_MODE).

We have no control over this because our product is an extension of another software that is responsible for the COM initialization.

Possible solution

However, simply removing the first FAILED check works fine and we end up with the correct full name. So it seems that getting RPC_E_CHANGED_MODE is not really an error case.

I can submit a PR if this seems reasonnable to just remove the first FAILED check.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.