hwinfo::getAllGPUs() is an OpenCL device list -- the prebuilt HWiNFO.lib has no Win32_VideoController path, only clGetPlatformIDs/clGetDeviceIDs/clGetDeviceInfo. A machine whose driver never registered an OpenCL ICD therefore reported no GPU at all, even with a healthy WDDM driver driving the display. Two consequences: the system-info JSON emitted "GPU":"", and CheckHardwareInformation() silently fell back to the CPU engine on a box holding a perfectly good CUDA card. DXGI needs only a WDDM display driver, so it sees the adapter either way. CheckHardwareInformation() now classifies adapters by PCI vendor id. Exact ids also retire the substring matching and its "ATI" inside "CORPORATION" workaround. It falls back to the OpenCL list when DXGI returns nothing. GetSystemHardwareInformation() keeps its OpenCL loop untouched and merely appends DXGI adapters that OpenCL did not already report, so the JSON stays byte-identical -- same keys, order, indices and values -- on any machine that already worked. Appended entries reuse OpenCL's vendor spelling (OpenClStyleVendor) and read the driver version from the display-adapter class key, since DXGI exposes neither. Verified on a dual-adapter box: the GPU node matches the pre-change output exactly, and forcing the append path yields the same shape with values sourced from DXGI plus the registry. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
70 lines
1.8 KiB
CMake
70 lines
1.8 KiB
CMake
# ANSLicensingSystem — DLL for license validation (also used by LabVIEW)
|
|
add_library(ANSLicensingSystem SHARED
|
|
ANSLicense.cpp
|
|
ANSLicense.h
|
|
Utility.cpp
|
|
Utility.h
|
|
pch.cpp
|
|
pch.h
|
|
framework.h
|
|
dllmain.cpp
|
|
)
|
|
|
|
target_include_directories(ANSLicensingSystem PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
${SHARED_INCLUDE_DIR}
|
|
# These are needed by consumers because ANSLicense.h / Utility.h include them
|
|
${ANSLIBS_DIR} # for LabVIEWHeader/extcode.h
|
|
${ANSLIBS_DIR}/ZLIB/include # for zlib.h (Utility.h includes it)
|
|
${VCPKG_INCLUDE_DIR} # for zip.h (Utility.h includes it)
|
|
)
|
|
|
|
target_include_directories(ANSLicensingSystem PRIVATE
|
|
${ANSLIBS_DIR}/ANS-HWiNFO/include
|
|
${ANSLIBS_DIR}/spdlog/include
|
|
)
|
|
|
|
target_link_libraries(ANSLicensingSystem
|
|
PRIVATE anslicensing
|
|
PRIVATE labview
|
|
PRIVATE opencv
|
|
PRIVATE zlib_dep
|
|
PRIVATE spdlog_dep
|
|
PUBLIC boost
|
|
)
|
|
|
|
target_link_directories(ANSLicensingSystem PRIVATE
|
|
${ANSLIBS_DIR}/ANS-HWiNFO/lib
|
|
${ANSLIBS_DIR}/boost/lib
|
|
${VCPKG_LIB_DIR}
|
|
)
|
|
|
|
# BASE64 class — not exported from anslicensing.dll, compile directly
|
|
target_include_directories(ANSLicensingSystem PRIVATE
|
|
${CMAKE_SOURCE_DIR}/core/anslicensing
|
|
)
|
|
target_sources(ANSLicensingSystem PRIVATE
|
|
${CMAKE_SOURCE_DIR}/core/anslicensing/base64.cpp
|
|
)
|
|
|
|
target_link_libraries(ANSLicensingSystem PRIVATE
|
|
HWiNFO.lib OpenCL.lib OpenCLExt.lib
|
|
bz2.lib zip.lib
|
|
libboost_log-vc143-mt-x64-1_82.lib
|
|
shlwapi.lib winhttp.lib
|
|
pdh.lib psapi.lib
|
|
wbemuuid.lib oleaut32.lib ole32.lib
|
|
dxgi.lib advapi32.lib
|
|
dnsapi.lib
|
|
${WIN_COMMON_LIBS}
|
|
)
|
|
|
|
target_compile_definitions(ANSLicensingSystem PRIVATE
|
|
ANSLICENSE_EXPORTS
|
|
ANSLICENSINGSYSTEM_EXPORTS
|
|
UNICODE _UNICODE
|
|
_USRDLL
|
|
)
|
|
|
|
target_precompile_headers(ANSLicensingSystem PRIVATE pch.h)
|