Skip to content

Commit 79de353

Browse files
authored
Merge pull request #398 from zhenyu-xu-metax/add-feature-support-metax
Feat: add support for METAX GPU
2 parents d823a79 + ac29e8e commit 79de353

File tree

4 files changed

+616
-0
lines changed

4 files changed

+616
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ if(APPLE)
7070
set(PANFROST_SUPPORT_DEFAULT OFF)
7171
set(PANTHOR_SUPPORT_DEFAULT OFF)
7272
set(ASCEND_SUPPORT_DEFAULT OFF)
73+
set(METAX_SUPPORT_DEFAULT OFF)
7374
elseif(ASCEND_SUPPORT)
7475
set(APPLE_SUPPORT_DEFAULT OFF)
7576
set(NVIDIA_SUPPORT_DEFAULT OFF)
@@ -79,6 +80,7 @@ elseif(ASCEND_SUPPORT)
7980
set(PANFROST_SUPPORT_DEFAULT OFF)
8081
set(PANTHOR_SUPPORT_DEFAULT OFF)
8182
set(ASCEND_SUPPORT_DEFAULT ON)
83+
set(METAX_SUPPORT_DEFAULT OFF)
8284
else()
8385
set(APPLE_SUPPORT_DEFAULT OFF)
8486
set(NVIDIA_SUPPORT_DEFAULT ON)
@@ -89,6 +91,7 @@ else()
8991
set(PANFROST_SUPPORT_DEFAULT ON)
9092
set(PANTHOR_SUPPORT_DEFAULT ON)
9193
set(ASCEND_SUPPORT_DEFAULT OFF)
94+
set(METAX_SUPPORT_DEFAULT ON)
9295
endif()
9396

9497
# TPU support is only available on Linux
@@ -128,6 +131,7 @@ option(ASCEND_SUPPORT "Build support for Ascend NPUs through Ascend DCMI" ${ASCE
128131
option(V3D_SUPPORT "Build support for Raspberrypi through v3d" ${V3D_SUPPORT_DEFAULT})
129132
option(TPU_SUPPORT "Build support for Google TPUs through GRPC" ${TPU_SUPPORT_DEFAULT})
130133
option(ROCKCHIP_SUPPORT "Enable support for Rockchip NPU" ${ROCKCHIP_SUPPORT_DEFAULT})
134+
option(METAX_SUPPORT "Build support for MetaX GPUs through libmxsml" ${METAX_SUPPORT_DEFAULT})
131135

132136
add_subdirectory(src)
133137

README.markdown

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ NVTOP supports Rockchip (testing on orangepi 5 plus).
144144

145145
Supports NPU frequency, temperature, utilization.
146146

147+
### MetaX
148+
149+
NVTOP supports MetaX (testing on MXC500) by MXSML LIBRARY.
150+
151+
For more information about GPUs please take a look at the [METAX documentation](https://developer.metax-tech.com/doc/index)
152+
147153
Build
148154
-----
149155

@@ -154,6 +160,8 @@ Several libraries are required in order for NVTOP to display GPU info:
154160
* For NVIDIA: the *NVIDIA Management Library* (*NVML*) which comes with the GPU driver.
155161
* This queries the GPU for info.
156162
* For AMD: the libdrm library used to query AMD GPUs through the kernel driver.
163+
* For METAX: the *MetaX System Management Library* (*MXSML*) which comes with the GPU driver.
164+
* This queries the GPU for info.
157165

158166
## Distribution Specific Installation Process
159167

src/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ if(ROCKCHIP_SUPPORT)
151151
target_sources(nvtop PRIVATE extract_npuinfo_rockchip.c)
152152
endif()
153153

154+
if(METAX_SUPPORT)
155+
target_sources(nvtop PRIVATE extract_gpuinfo_metax.c)
156+
endif()
157+
154158
target_include_directories(nvtop PRIVATE
155159
${PROJECT_SOURCE_DIR}/include
156160
${PROJECT_BINARY_DIR}/include)

0 commit comments

Comments
 (0)