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,325 @@
1
+ //
2
+ // Copyright (c) 2021 - 2025 Advanced Micro Devices, Inc. All rights reserved.
3
+ //
4
+ //-------------------------------------------------------------------------------------------------
5
+
6
+ #ifndef ADLX_ICOLLECTIONS_H
7
+ #define ADLX_ICOLLECTIONS_H
8
+ #pragma once
9
+
10
+ #include "ADLXDefines.h"
11
+
12
+ //-------------------------------------------------------------------------------------------------
13
+ //ICollections.h - Interfaces for ADLX collections
14
+
15
+ // These interfaces are used when ADLX returns or receives many-of collections
16
+
17
+ //IADLXList allows iterating forward in a collection of objects, similar with an stl vector
18
+ #pragma region IADLXList interface
19
+ #if defined (__cplusplus)
20
+ namespace adlx
21
+ {
22
+ class ADLX_NO_VTABLE IADLXList : public IADLXInterface
23
+ {
24
+ public:
25
+ ADLX_DECLARE_IID (L"IADLXList")
26
+ //Lists must declare the type of items it holds - what was passed as ADLX_DECLARE_IID() in that interface
27
+ ADLX_DECLARE_ITEM_IID (L"IADLXInterface")
28
+
29
+ /**
30
+ @page DOX_IADLXList_Size Size
31
+ @ENG_START_DOX
32
+ @brief Returns the number of interfaces in a list.
33
+ @ENG_END_DOX
34
+
35
+ @syntax
36
+ @codeStart
37
+ adlx_uint Size ()
38
+ @codeEnd
39
+
40
+ @params
41
+
42
+ N/A
43
+
44
+ @retvalues
45
+ @ENG_START_DOX
46
+ Returns the number of interfaces in the list.
47
+ @ENG_END_DOX
48
+
49
+ @detaileddesc
50
+ @ENG_START_DOX
51
+ @details Returns the number of interfaces in the list.<br>
52
+
53
+ Returns zero if the list is empty.
54
+
55
+ @ENG_END_DOX
56
+
57
+ @copydoc IADLXList_REQ_TABLE
58
+
59
+ */
60
+ virtual adlx_uint ADLX_STD_CALL Size () = 0;
61
+ /**
62
+ @page DOX_IADLXList_Empty Empty
63
+ @ENG_START_DOX
64
+ @brief Checks if the list is empty.
65
+ @ENG_END_DOX
66
+
67
+ @syntax
68
+ @codeStart
69
+ adlx_bool Empty ()
70
+ @codeEnd
71
+
72
+ @params
73
+
74
+ N/A
75
+
76
+ @retvalues
77
+ @ENG_START_DOX
78
+ If the list is empty, __true__ is returned.<br>
79
+ If the list is not empty, __false__ is returned.<br>
80
+ @ENG_END_DOX
81
+
82
+ @detaileddesc
83
+ @ENG_START_DOX
84
+ @details If the list has no interfaces, then @ref DOX_IADLXList_Size will return zero, and __Empty__ will return __true__.
85
+ @ENG_END_DOX
86
+
87
+ @copydoc IADLXList_REQ_TABLE
88
+
89
+ */
90
+ virtual adlx_bool ADLX_STD_CALL Empty () = 0;
91
+
92
+ /**
93
+ @page DOX_IADLXList_Begin Begin
94
+ @ENG_START_DOX
95
+ @brief Returns the location of the first interface from a list.
96
+ @ENG_END_DOX
97
+
98
+ @syntax
99
+ @codeStart
100
+ adlx_uint Begin ()
101
+ @codeEnd
102
+
103
+ @params
104
+
105
+ N/A
106
+
107
+ @retvalues
108
+ @ENG_START_DOX
109
+ If the list is not empty it returns the location of the first interface in the list.<br>
110
+ If the list is empty the returned location is same as the location returned by @ref DOX_IADLXList_End.<br>
111
+ @ENG_END_DOX
112
+
113
+ @detaileddesc
114
+ @ENG_START_DOX
115
+ @details The returned location is valid if it is less than the location returned by @ref DOX_IADLXList_End.
116
+ The __Begin__ is used in combination with @ref DOX_IADLXList_End for parsing the list sequentially from the beginning to the end.<br>
117
+ If the list is empty, __Begin__ and @ref DOX_IADLXList_End return the same location.
118
+ @ENG_END_DOX
119
+ @image html list.png height=150
120
+ @snippetCode
121
+ @snippet ADLXSnippet.h Iterate ADLXList
122
+
123
+ @copydoc IADLXList_REQ_TABLE
124
+
125
+ */
126
+ virtual adlx_uint ADLX_STD_CALL Begin () = 0;
127
+ /**
128
+ @page DOX_IADLXList_End End
129
+ @ENG_START_DOX
130
+ @brief Returns the location succeeding the last interface from a list.
131
+ @ENG_END_DOX
132
+
133
+ @syntax
134
+ @codeStart
135
+ adlx_uint End ()
136
+ @codeEnd
137
+
138
+ @params
139
+
140
+ N/A
141
+
142
+ @retvalues
143
+ @ENG_START_DOX
144
+ Returns the location succeeding the last interface from a list.
145
+ @ENG_END_DOX
146
+
147
+ @detaileddesc
148
+ @ENG_START_DOX
149
+ @details The returned location is a logical representation of the end of the list. It does not hold any valid interface and should not be dereferenced.<br>
150
+ __End__ is used in combination with @ref DOX_IADLXList_Begin for parsing the list sequentially from the beginning to the end.<br>
151
+ If the list is empty, then @ref DOX_IADLXList_Begin and __End__ return the same location.
152
+
153
+ @ENG_END_DOX
154
+ @image html list.png height=150
155
+ @snippetCode
156
+ @snippet ADLXSnippet.h Iterate ADLXList
157
+
158
+ @copydoc IADLXList_REQ_TABLE
159
+
160
+ */
161
+ virtual adlx_uint ADLX_STD_CALL End () = 0;
162
+
163
+ /**
164
+ @page DOX_IADLXList_At At
165
+ @ENG_START_DOX
166
+ @brief Returns the reference counted interface from the requested location.
167
+ @ENG_END_DOX
168
+
169
+ @syntax
170
+ @codeStart
171
+ @ref ADLX_RESULT At (const adlx_uint location, @ref DOX_IADLXInterface** ppItem)
172
+ @codeEnd
173
+
174
+ @params
175
+ @paramrow{1.,[in] ,location,const adlx_uint,@ENG_START_DOX The location of the returned interface. @ENG_END_DOX}
176
+ @paramrow{2.,[out] ,ppItem,@ref DOX_IADLXInterface**,@ENG_START_DOX The address of a pointer to the returned interface. If the interface is not successfully returned\, the method sets dereferenced address __*ppItem__ to __nullptr__. @ENG_END_DOX}
177
+
178
+ @retvalues
179
+ @ENG_START_DOX
180
+ If the location is within the list bounds, __ADLX_OK__ is returned.<br>
181
+ If the location is not within the list bounds, an error code is returned.<br>
182
+ Refer to @ref ADLX_RESULT for success codes and error codes.
183
+
184
+ @ENG_END_DOX
185
+
186
+ @detaileddesc
187
+ @ENG_START_DOX
188
+ @details @ref DOX_IADLXList is a collection of interfaces which runs incrementally from beginning to the end.<br> The returned interface must be discarded with @ref DOX_IADLXInterface_Release when no longer needed.
189
+ @ENG_END_DOX
190
+ @addinfo
191
+ @ENG_START_DOX
192
+ 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.
193
+ @ENG_END_DOX
194
+
195
+ @copydoc IADLXList_REQ_TABLE
196
+
197
+ */
198
+ virtual ADLX_RESULT ADLX_STD_CALL At (const adlx_uint location, IADLXInterface** ppItem) = 0;
199
+
200
+ /**
201
+ @page DOX_IADLXList_Clear Clear
202
+ @ENG_START_DOX
203
+ @brief Removes all the interfaces from a list.
204
+ @ENG_END_DOX
205
+
206
+ @syntax
207
+ @codeStart
208
+ @ref ADLX_RESULT Clear ()
209
+ @codeEnd
210
+
211
+ @params
212
+
213
+ N/A
214
+
215
+ @retvalues
216
+ @ENG_START_DOX
217
+ If all the interfaces from the list are successfully removed, __ADLX_OK__ is returned. <br>
218
+ If interfaces from the list are not successfully removed, an error code is returned. <br>
219
+ Refer to @ref ADLX_RESULT for success codes and error codes.
220
+
221
+ @ENG_END_DOX
222
+
223
+ @detaileddesc
224
+ @ENG_START_DOX
225
+ @details After this call returns successfully, @ref DOX_IADLXList_Size returns zero.
226
+ @ENG_END_DOX
227
+
228
+ @copydoc IADLXList_REQ_TABLE
229
+
230
+ */
231
+ virtual ADLX_RESULT ADLX_STD_CALL Clear () = 0;
232
+ /**
233
+ @page DOX_IADLXList_Remove_Back Remove_Back
234
+ @ENG_START_DOX
235
+ @brief Removes an interface from the end of a list.
236
+ @ENG_END_DOX
237
+
238
+ @syntax
239
+ @codeStart
240
+ @ref ADLX_RESULT Remove_Back ()
241
+ @codeEnd
242
+
243
+ @params
244
+
245
+ N/A
246
+
247
+ @retvalues
248
+ @ENG_START_DOX
249
+ If the interface from the end of the list is successfully removed, __ADLX_OK__ is returned. <br>
250
+ If the interface from the end of the list is not successfully removed, an error code is returned. <br>
251
+ Refer to @ref ADLX_RESULT for success codes and error codes.
252
+
253
+ @ENG_END_DOX
254
+
255
+ @detaileddesc
256
+ @ENG_START_DOX
257
+ @details Removes an interface from the end of the list. The list must not be empty.
258
+ @ENG_END_DOX
259
+
260
+ @copydoc IADLXList_REQ_TABLE
261
+
262
+ */
263
+ virtual ADLX_RESULT ADLX_STD_CALL Remove_Back () = 0;
264
+ /**
265
+ @page DOX_IADLXList_Add_Back Add_Back
266
+ @ENG_START_DOX
267
+ @brief Adds an interface to the end of a list.
268
+ @ENG_END_DOX
269
+
270
+ @syntax
271
+ @codeStart
272
+ @ref ADLX_RESULT Add_Back (@ref DOX_IADLXInterface* pItem)
273
+ @codeEnd
274
+
275
+ @params
276
+ @paramrow{1.,[in] ,pItem,@ref DOX_IADLXInterface*,@ENG_START_DOX The pointer to the interface to be added to the list. @ENG_END_DOX}
277
+
278
+ @retvalues
279
+ @ENG_START_DOX
280
+ If the interface is added successfully to the end of the list, __ADLX_OK__ is returned. <br>
281
+ If the interface is not added to the end of the list, an error code is returned. <br>
282
+ Refer to @ref ADLX_RESULT for success codes and error codes.
283
+
284
+ @ENG_END_DOX
285
+
286
+
287
+ @copydoc IADLXList_REQ_TABLE
288
+
289
+ */
290
+ virtual ADLX_RESULT ADLX_STD_CALL Add_Back (IADLXInterface* pItem) = 0;
291
+ }; //IADLXList
292
+ //----------------------------------------------------------------------------------------------
293
+ typedef IADLXInterfacePtr_T<IADLXList> IADLXListPtr;
294
+ } // namespace adlx
295
+ #else
296
+ ADLX_DECLARE_IID (IADLXList, L"IADLXList")
297
+ ADLX_DECLARE_ITEM_IID (IADLXInterface, L"IADLXInterface")
298
+ typedef struct IADLXList IADLXList;
299
+ typedef struct IADLXListVtbl
300
+ {
301
+ //IADLXInterface
302
+ adlx_long (ADLX_STD_CALL *Acquire)(IADLXList* pThis);
303
+ adlx_long (ADLX_STD_CALL *Release)(IADLXList* pThis);
304
+ ADLX_RESULT (ADLX_STD_CALL *QueryInterface)(IADLXList* pThis, const wchar_t* interfaceId, void** ppInterface);
305
+
306
+ //IADLXList
307
+ adlx_uint (ADLX_STD_CALL *Size)(IADLXList* pThis);
308
+ adlx_bool (ADLX_STD_CALL *Empty)(IADLXList* pThis);
309
+ adlx_uint (ADLX_STD_CALL *Begin)(IADLXList* pThis);
310
+ adlx_uint (ADLX_STD_CALL *End)(IADLXList* pThis);
311
+ ADLX_RESULT (ADLX_STD_CALL *At)(IADLXList* pThis, const adlx_uint location, IADLXInterface** ppItem);
312
+ ADLX_RESULT (ADLX_STD_CALL *Clear)(IADLXList* pThis);
313
+ ADLX_RESULT (ADLX_STD_CALL *Remove_Back)(IADLXList* pThis);
314
+ ADLX_RESULT (ADLX_STD_CALL *Add_Back)(IADLXList* pThis, IADLXInterface* pItem);
315
+ }IADLXListVtbl;
316
+
317
+ struct IADLXList
318
+ {
319
+ const IADLXListVtbl *pVtbl;
320
+ };
321
+
322
+ #endif
323
+ #pragma endregion IADLXList interface
324
+
325
+ #endif//ADLX_ICOLLECTIONS_H