node-gpuinfo 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +336 -0
  3. package/binding.gyp +69 -0
  4. package/build/Release/gpu.exp +0 -0
  5. package/build/Release/gpu.lib +0 -0
  6. package/build/Release/gpu.node +0 -0
  7. package/build/Release/gpu.pdb +0 -0
  8. package/build/binding.sln +19 -0
  9. package/build/gpu.vcxproj +175 -0
  10. package/build/gpu.vcxproj.filters +169 -0
  11. package/example.js +69 -0
  12. package/index.js +33 -0
  13. package/package.json +68 -0
  14. package/src/binding.cpp +201 -0
  15. package/src/gpu_info.c +130 -0
  16. package/src/gpu_info.h +86 -0
  17. package/src/includes/adlx/ADLX.h +367 -0
  18. package/src/includes/adlx/ADLXDefines.h +1345 -0
  19. package/src/includes/adlx/ADLXHelper/ADLXHelper.c +175 -0
  20. package/src/includes/adlx/ADLXHelper/ADLXHelper.h +245 -0
  21. package/src/includes/adlx/ADLXHelper/WinAPIS.c +64 -0
  22. package/src/includes/adlx/ADLXStructures.h +206 -0
  23. package/src/includes/adlx/ADLXVersion.h +18 -0
  24. package/src/includes/adlx/I3DSettings.h +3476 -0
  25. package/src/includes/adlx/I3DSettings1.h +292 -0
  26. package/src/includes/adlx/I3DSettings2.h +317 -0
  27. package/src/includes/adlx/IApplications.h +397 -0
  28. package/src/includes/adlx/IChangedEvent.h +71 -0
  29. package/src/includes/adlx/ICollections.h +325 -0
  30. package/src/includes/adlx/IDesktops.h +918 -0
  31. package/src/includes/adlx/IDisplay3DLUT.h +663 -0
  32. package/src/includes/adlx/IDisplayGamma.h +683 -0
  33. package/src/includes/adlx/IDisplayGamut.h +760 -0
  34. package/src/includes/adlx/IDisplaySettings.h +3476 -0
  35. package/src/includes/adlx/IDisplays.h +2676 -0
  36. package/src/includes/adlx/IDisplays1.h +191 -0
  37. package/src/includes/adlx/IDisplays2.h +188 -0
  38. package/src/includes/adlx/IDisplays3.h +256 -0
  39. package/src/includes/adlx/IGPUAutoTuning.h +460 -0
  40. package/src/includes/adlx/IGPUManualFanTuning.h +1007 -0
  41. package/src/includes/adlx/IGPUManualGFXTuning.h +607 -0
  42. package/src/includes/adlx/IGPUManualPowerTuning.h +340 -0
  43. package/src/includes/adlx/IGPUManualVRAMTuning.h +576 -0
  44. package/src/includes/adlx/IGPUPresetTuning.h +469 -0
  45. package/src/includes/adlx/IGPUTuning.h +1239 -0
  46. package/src/includes/adlx/IGPUTuning1.h +197 -0
  47. package/src/includes/adlx/II2C.h +198 -0
  48. package/src/includes/adlx/ILog.h +72 -0
  49. package/src/includes/adlx/IMultiMedia.h +578 -0
  50. package/src/includes/adlx/IPerformanceMonitoring.h +2520 -0
  51. package/src/includes/adlx/IPerformanceMonitoring1.h +134 -0
  52. package/src/includes/adlx/IPerformanceMonitoring2.h +341 -0
  53. package/src/includes/adlx/IPerformanceMonitoring3.h +199 -0
  54. package/src/includes/adlx/IPowerTuning.h +473 -0
  55. package/src/includes/adlx/IPowerTuning1.h +515 -0
  56. package/src/includes/adlx/ISmartAccessMemory.h +114 -0
  57. package/src/includes/adlx/ISystem.h +1557 -0
  58. package/src/includes/adlx/ISystem1.h +237 -0
  59. package/src/includes/adlx/ISystem2.h +643 -0
  60. package/src/linux/amd_linux.c +269 -0
  61. package/src/linux/intel_linux.c +20 -0
  62. package/src/linux/nvidia_linux.c +257 -0
  63. package/src/macos/amd_mac.c +131 -0
  64. package/src/macos/intel_mac.c +131 -0
  65. package/src/macos/nvidia_mac.c +21 -0
  66. package/src/vendor/amd.c +37 -0
  67. package/src/vendor/intel.c +37 -0
  68. package/src/vendor/nvidia.c +37 -0
  69. package/src/windows/amd_windows.c +468 -0
  70. package/src/windows/intel_windows.c +157 -0
  71. package/src/windows/nvidia_windows.c +252 -0
@@ -0,0 +1,237 @@
1
+ //
2
+ // Copyright (c) 2021 - 2025 Advanced Micro Devices, Inc. All rights reserved.
3
+ //
4
+ //-------------------------------------------------------------------------------------------------
5
+
6
+ #ifndef ADLX_ISYSTEM1_H
7
+ #define ADLX_ISYSTEM1_H
8
+ #pragma once
9
+
10
+ #include "ISystem.h"
11
+
12
+ // Interfaces for GPU1 Info
13
+ #pragma region IADLXGPU1 interface
14
+ #if defined (__cplusplus)
15
+ namespace adlx
16
+ {
17
+ class ADLX_NO_VTABLE IADLXGPU1 : public IADLXGPU
18
+ {
19
+ public:
20
+ ADLX_DECLARE_IID(L"IADLXGPU1")
21
+
22
+ /**
23
+ * @page DOX_IADLXGPU1_PCIBusType PCIBusType
24
+ * @ENG_START_DOX @brief Gets the PCI bus type of a GPU. @ENG_END_DOX
25
+ * @syntax
26
+ * @codeStart
27
+ * @ref ADLX_RESULT PCIBusType (@ref ADLX_PCI_BUS_TYPE* busType)
28
+ * @codeEnd
29
+ *
30
+ * @params
31
+ * @paramrow{1.,[out],busType,@ref ADLX_PCI_BUS_TYPE*,@ENG_START_DOX The pointer to a variable where the GPU PCI bus type is returned. @ENG_END_DOX}
32
+ *
33
+ * @retvalues
34
+ * @ENG_START_DOX
35
+ * If the GPU PCI bus type is successfully returned, __ADLX_OK__ is returned.<br>
36
+ * If the GPU PCI bus type is not successfully returned, an error code is returned.<br>
37
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br>
38
+ * @ENG_END_DOX
39
+ *
40
+ * @copydoc IADLXGPU1_REQ_TABLE
41
+ *
42
+ */
43
+ virtual ADLX_RESULT ADLX_STD_CALL PCIBusType(ADLX_PCI_BUS_TYPE* busType) const = 0;
44
+
45
+ /**
46
+ * @page DOX_IADLXGPU1_PCIBusLaneWidth PCIBusLaneWidth
47
+ * @ENG_START_DOX @brief Gets the PCI bus lane width of a GPU. @ENG_END_DOX
48
+ *
49
+ * @syntax
50
+ * @codeStart
51
+ * @ref ADLX_RESULT PCIBusLaneWidth (adlx_uint* laneWidth)
52
+ * @codeEnd
53
+ *
54
+ * @params
55
+ * @paramrow{1.,[out] ,laneWidth,adlx_uint* ,@ENG_START_DOX The pointer to a variable where the PCI bus lane width is returned. @ENG_END_DOX}
56
+ *
57
+ * @retvalues
58
+ * @ENG_START_DOX If the PCI bus lane width is successfully returned, __ADLX_OK__ is returned.<br>
59
+ * If the PCI bus lane width is not successfully returned, an error code is returned.<br>
60
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br> @ENG_END_DOX
61
+ *
62
+ * @copydoc IADLXGPU1_REQ_TABLE
63
+ *
64
+ */
65
+ virtual ADLX_RESULT ADLX_STD_CALL PCIBusLaneWidth(adlx_uint* laneWidth) const = 0;
66
+
67
+ /**
68
+ * @page DOX_IADLXGPU1_MultiGPUMode MultiGPUMode
69
+ * @ENG_START_DOX @brief Gets the AMD MGPU mode of a GPU. @ENG_END_DOX
70
+ * @syntax
71
+ * @codeStart
72
+ * @ref ADLX_RESULT MultiGPUMode (@ref ADLX_MGPU_MODE* mode)
73
+ * @codeEnd
74
+ *
75
+ * @params
76
+ * @paramrow{1.,[out],mode,ADLX_MGPU_MODE*,@ENG_START_DOX The pointer to a variable where the AMD MGPU mode is returned. The variable is __MGPU_NONE__ if the GPU is not part of an AMD MGPU configuration. The variable is __MGPU_PRIMARY__ if the GPU is the primary GPU in an AMD MGPU configuration. The variable is __MGPU_SECONDARY__ if the GPU is the secondary GPU in an AMD MGPU configuration. @ENG_END_DOX}
77
+ *
78
+ * @retvalues
79
+ * @ENG_START_DOX
80
+ * If __MultiGPUMode__ is successfully returned, __ADLX_OK__ is returned.<br>
81
+ * If __MultiGPUMode__ is not successfully returned, an error code is returned.<br>
82
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br>
83
+ * @ENG_END_DOX
84
+ *
85
+ * @addinfo
86
+ * @ENG_START_DOX
87
+ * AMD MGPU technology harnesses the power of two or more discrete graphics cards working in parallel to dramatically improve performance in games and applications.<br>
88
+ * On systems with AMD MGPU enabled the video output is delivered through the primary GPU and the workload is allocated to all supported GPUs in the setup.<br>
89
+ * @ENG_END_DOX
90
+ *
91
+ * @copydoc IADLXGPU1_REQ_TABLE
92
+ *
93
+ */
94
+ virtual ADLX_RESULT ADLX_STD_CALL MultiGPUMode(ADLX_MGPU_MODE* mode) = 0;
95
+
96
+ /**
97
+ * @page DOX_IADLXGPU1_ProductName ProductName
98
+ * @ENG_START_DOX @brief Gets the product name of a GPU. @ENG_END_DOX
99
+ * @syntax
100
+ * @codeStart
101
+ * @ref ADLX_RESULT ProductName (const char** productName)
102
+ * @codeEnd
103
+ *
104
+ * @params
105
+ * @paramrow{1.,[out],productName,const char**,@ENG_START_DOX The pointer to a zero-terminated string where the productName string of a GPU is returned. @ENG_END_DOX}
106
+ *
107
+ * @retvalues
108
+ * @ENG_START_DOX
109
+ * If the productName string is successfully returned, __ADLX_OK__ is returned.<br>
110
+ * If the productName string is not successfully returned, an error code is returned.<br>
111
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br>
112
+ * @ENG_END_DOX
113
+ *
114
+ * @addinfo
115
+ * @ENG_START_DOX
116
+ * The returned memory buffer is valid within a lifetime of the @ref DOX_IADLXGPU1 interface.<br>
117
+ * If the application uses the productName string beyond the lifetime of the @ref DOX_IADLXGPU1 interface, the application must make a copy of the productName string.<br>
118
+ * @ENG_END_DOX
119
+ *
120
+ * @copydoc IADLXGPU1_REQ_TABLE
121
+ *
122
+ */
123
+ virtual ADLX_RESULT ADLX_STD_CALL ProductName(const char** productName) const = 0;
124
+ }; //IADLXGPU1
125
+ //----------------------------------------------------------------------------------------------
126
+ typedef IADLXInterfacePtr_T<IADLXGPU1> IADLXGPU1Ptr;
127
+ } //namespace adlx
128
+ #else
129
+ ADLX_DECLARE_IID(IADLXGPU1, L"IADLXGPU1");
130
+ typedef struct IADLXGPU1 IADLXGPU1;
131
+
132
+ typedef struct IADLXGPU1Vtbl
133
+ {
134
+ //IADLXInterface
135
+ adlx_long(ADLX_STD_CALL* Acquire)(IADLXGPU1* pThis);
136
+ adlx_long(ADLX_STD_CALL* Release)(IADLXGPU1* pThis);
137
+ ADLX_RESULT(ADLX_STD_CALL* QueryInterface)(IADLXGPU1* pThis, const wchar_t* interfaceId, void** ppInterface);
138
+ //IADLXGPU
139
+ ADLX_RESULT(ADLX_STD_CALL* VendorId)(IADLXGPU1* pThis, const char** vendorId);
140
+ ADLX_RESULT(ADLX_STD_CALL* ASICFamilyType)(IADLXGPU1* pThis, ADLX_ASIC_FAMILY_TYPE* asicFamilyType);
141
+ ADLX_RESULT(ADLX_STD_CALL* Type)(IADLXGPU1* pThis, ADLX_GPU_TYPE* gpuType);
142
+ ADLX_RESULT(ADLX_STD_CALL* IsExternal)(IADLXGPU1* pThis, adlx_bool* isExternal);
143
+ ADLX_RESULT(ADLX_STD_CALL* Name)(IADLXGPU1* pThis, const char** gpuName);
144
+ ADLX_RESULT(ADLX_STD_CALL* DriverPath)(IADLXGPU1* pThis, const char** driverPath);
145
+ ADLX_RESULT(ADLX_STD_CALL* PNPString)(IADLXGPU1* pThis, const char** pnpString);
146
+ ADLX_RESULT(ADLX_STD_CALL* HasDesktops)(IADLXGPU1* pThis, adlx_bool* hasDesktops);
147
+ ADLX_RESULT(ADLX_STD_CALL* TotalVRAM)(IADLXGPU1* pThis, adlx_uint* vramMB);
148
+ ADLX_RESULT(ADLX_STD_CALL* VRAMType)(IADLXGPU1* pThis, const char** type);
149
+ ADLX_RESULT(ADLX_STD_CALL* BIOSInfo)(IADLXGPU1* pThis, const char** partNumber, const char** version, const char** date);
150
+ ADLX_RESULT(ADLX_STD_CALL* DeviceId)(IADLXGPU1* pThis, const char** deviceId);
151
+ ADLX_RESULT(ADLX_STD_CALL* RevisionId)(IADLXGPU1* pThis, const char** revisionId);
152
+ ADLX_RESULT(ADLX_STD_CALL* SubSystemId)(IADLXGPU1* pThis, const char** subSystemId);
153
+ ADLX_RESULT(ADLX_STD_CALL* SubSystemVendorId)(IADLXGPU1* pThis, const char** subSystemVendorId);
154
+ ADLX_RESULT(ADLX_STD_CALL* UniqueId)(IADLXGPU1* pThis, adlx_int* uniqueId);
155
+ //IADLXGPU1
156
+ ADLX_RESULT(ADLX_STD_CALL* PCIBusType)(IADLXGPU1* pThis, ADLX_PCI_BUS_TYPE* busType);
157
+ ADLX_RESULT(ADLX_STD_CALL* PCIBusLaneWidth)(IADLXGPU1* pThis, adlx_uint* laneWidth);
158
+ ADLX_RESULT(ADLX_STD_CALL* MultiGPUMode)(IADLXGPU1* pThis, ADLX_MGPU_MODE* mode);
159
+ ADLX_RESULT(ADLX_STD_CALL* ProductName)(IADLXGPU1* pThis, const char** productName);
160
+ } IADLXGPU1Vtbl;
161
+
162
+ struct IADLXGPU1
163
+ {
164
+ const IADLXGPU1Vtbl* pVtbl;
165
+ };
166
+ #endif
167
+ #pragma endregion IADLXGPU1 interface
168
+
169
+
170
+ #pragma region IADLXSystem1 interface
171
+ #if defined (__cplusplus)
172
+ namespace adlx
173
+ {
174
+ class ADLX_NO_VTABLE IADLXPowerTuningServices;
175
+
176
+ class ADLX_NO_VTABLE IADLXSystem1 : public IADLXInterface
177
+ {
178
+ public:
179
+ ADLX_DECLARE_IID (L"IADLXSystem1")
180
+
181
+ /**
182
+ * @page DOX_IADLXSystem1_GetPowerTuningServices GetPowerTuningServices
183
+ * @ENG_START_DOX
184
+ * @brief Gets the reference counted main interface to the @ref DOX_IADLXPowerTuningServices "Power Tuning" domain.
185
+ * @ENG_END_DOX
186
+ *
187
+ * @syntax
188
+ * @codeStart
189
+ * @ref ADLX_RESULT GetPowerTuningServices (@ref DOX_IADLXPowerTuningServices** ppPowerTuningServices)
190
+ * @codeEnd
191
+ *
192
+ * @params
193
+ * @paramrow{1.,[out] ,ppPowerTuningServices,@ref DOX_IADLXPowerTuningServices**,@ENG_START_DOX The address of a pointer to the returned interface. If the interface is not successfully returned\, the method sets the dereferenced address __*ppPowerTuningServices__ to __nullptr__. @ENG_END_DOX}
194
+ *
195
+ * @retvalues
196
+ * @ENG_START_DOX
197
+ * If the interface is successfully returned, __ADLX_OK__ is returned.<br>
198
+ * If the interface is not successfully returned, an error code is returned.<br>
199
+ * Refer to @ref ADLX_RESULT for success codes and error codes.<br>
200
+ * @ENG_END_DOX
201
+ *
202
+ * @detaileddesc
203
+ * @ENG_START_DOX
204
+ * @details The returned interface must be discarded with @ref DOX_IADLXInterface_Release when it is no longer needed.
205
+ * @ENG_END_DOX
206
+ *
207
+ * @addinfo
208
+ * @ENG_START_DOX In C++, when using ADLX interfaces as smart pointers, there is no need to call @ref DOX_IADLXInterface_Release because smart pointers call it in their internal implementation. @ENG_END_DOX
209
+ *
210
+ * @copydoc IADLXSystem1_REQ_TABLE
211
+ *
212
+ */
213
+ virtual ADLX_RESULT ADLX_STD_CALL GetPowerTuningServices(IADLXPowerTuningServices** ppPowerTuningServices) = 0;
214
+ }; //IADLXSystem1
215
+ typedef IADLXInterfacePtr_T<IADLXSystem1> IADLXSystem1Ptr;
216
+ } //namespace adlx
217
+ #else
218
+ ADLX_DECLARE_IID (IADLXSystem1, L"IADLXSystem1")
219
+
220
+ typedef struct IADLXPowerTuningServices IADLXPowerTuningServices;
221
+ typedef struct IADLXSystem1 IADLXSystem1;
222
+ typedef struct IADLXSystem1Vtbl
223
+ {
224
+ //IADLXInterface
225
+ adlx_long (ADLX_STD_CALL *Acquire)(IADLXSystem1* pThis);
226
+ adlx_long (ADLX_STD_CALL *Release)(IADLXSystem1* pThis);
227
+ ADLX_RESULT (ADLX_STD_CALL *QueryInterface)(IADLXSystem1* pThis, const wchar_t* interfaceId, void** ppInterface);
228
+
229
+ //IADLXSystem1
230
+ ADLX_RESULT (ADLX_STD_CALL *GetPowerTuningServices)(IADLXSystem1* pThis, IADLXPowerTuningServices** ppPowerTuningServices);
231
+ } IADLXSystem1Vtbl;
232
+
233
+ struct IADLXSystem1 { const IADLXSystem1Vtbl*pVtbl; };
234
+ #endif
235
+ #pragma endregion IADLXSystem1 interface
236
+
237
+ #endif //ADLX_ISYSTEM1_H