Skip to content

add windows support#10

Merged
yeahdongcn merged 2 commits intoMooreThreads:mainfrom
gingerXue:supportwin
Mar 10, 2026
Merged

add windows support#10
yeahdongcn merged 2 commits intoMooreThreads:mainfrom
gingerXue:supportwin

Conversation

@gingerXue
Copy link

@gingerXue gingerXue commented Mar 10, 2026

  • Support pymtml running on the Windows platform
  • Refine the doc
  • Refine the LoadMtmlLibrary code to split the platform-specific library loading logic

Test Result:

Windows

Initializing MTML library...

============================================================
 MTML Python Bindings Test Suite
============================================================

============================================================
 Library APIs
============================================================
  Library Version: 2024.11.15
  Device Count: 1
  Driver Version: 32.0.2510.1001
  Free System: OK

Found 1 device(s)

============================================================
 Device 0 - Basic APIs
============================================================
  Index: 0
  Name: MTT S80
  UUID: 8b92f6da-0f72-1c4f-64d7-594cba05cc7a
  Brand: 0
  Serial Number: [MTMLError: Not Supported]
  Power Usage (mW): 127588
  GPU Path: [MTMLError: Not Supported]
  Primary Path: [MTMLError: Not Supported]
  Render Path: [MTMLError: Not Supported]
  VBIOS Version: 2.4.1
  MtBios Version: 2.4.1
  GPU Cores Count: [MTMLError: Not Supported]

============================================================
 Device 0 - PCI APIs
============================================================
  PCI Info: c_mtmlPciInfo_t(sbdf: 00000000:01:00.0, segment: 0, bus: 1, device: 0, pciDeviceId: 33627861, busWidth: 33627861, pciMaxSpeed: 0.0, pciCurSpeed: 32.0, pciMaxWidth: 1107296256, pciCurWidth: 16, pciMaxGen: 16, pciCurGen: 5, busId: 00000000:01:00.0, rsvd: <pymtml.c_ulong_Array_6 object at 0x000001DEF04E82D0>)
  PCI Info busId populated: 00000000:01:00.0
  PCIe Slot Info: [MTMLError: Not Supported]

============================================================
 Device 0 - Fan APIs
============================================================
  Fan Count: 1
  Fan 0 Speed (%): 30
  Fan 0 RPM: 1829

============================================================
 Device 0 - Display APIs
============================================================
  Display APIs: [MTMLError: Not Supported]

============================================================
 Device 0 - Property APIs
============================================================
  Device Property: c_mtmlDeviceProperty_t(virtCapability: 0, virtRole: 0, mpcCapability: 0, mpcType: 0, rsvd: <pymtml.c_ulong_Array_12 object at 0x000001DEF04E82D0>)

============================================================
 Device 0 - GPU APIs
============================================================
  GPU Utilization (%): 0
  GPU Temperature (C): 56
  GPU Clock (MHz): 1800
  GPU Max Clock (MHz): 1800
  Geometry Engine Util (%): [MTMLError: Not Supported]
  2D Engine Util (%): [MTMLError: Not Supported]
  3D Engine Util (%): [MTMLError: Not Supported]
  Compute Engine Util (%): [MTMLError: Not Supported]

============================================================
 Device 0 - Memory APIs
============================================================
  Total Memory (bytes): 17179869184
  Used Memory (bytes): 1591889920
  System Used Memory: 338399232
  Memory Utilization (%): 9
  Memory Clock (MHz): 1750
  Memory Max Clock (MHz): 1750
  Memory Bus Width (bits): 256
  Memory Bandwidth (GB/s): 448
  Memory Speed (Mbps): 14000
  Memory Vendor: [MTMLError: Not Supported]
  Memory Type: 1

============================================================
 Device 0 - VPU APIs
============================================================
  VPU Clock (MHz): [MTMLError: Not Supported]
  VPU Max Clock (MHz): [MTMLError: Not Supported]
  VPU Utilization: [MTMLError: Not Supported]
  Codec Capacity: [MTMLError: Not Supported]

============================================================
 Device 0 - MtLink APIs
============================================================
  MtLink Spec: [MTMLError: Not Supported]
  MtLink APIs: [MTMLError: Not Supported]

============================================================
 Device 0 - ECC APIs
============================================================
  ECC Mode: [MTMLError: Not Supported]
  Retired Pages Count: [MTMLError: Not Supported]
  Retired Pages Pending: [MTMLError: Not Supported]
  ECC Corrected Errors: [MTMLError: Not Supported]
  ECC Uncorrected Errors: [MTMLError: Not Supported]

============================================================
 Device 0 - MPC APIs
============================================================
  MPC Mode: 0
  Supported MPC Profiles Count: [MTMLError: Not Supported]
  Supported MPC Configurations Count: [MTMLError: Not Supported]
  MPC Instances Count: [MTMLError: Not Supported]
  Current MPC Configuration: [MTMLError: Not Supported]

============================================================
 Device 0 - Virtualization APIs
============================================================
  Supported Virt Types Count: [MTMLError: Not Supported]
  Available Virt Types Count: [MTMLError: Not Supported]
  Active Virt Devices Count: [MTMLError: Not Supported]

============================================================
 Device 0 - NVML Wrapper APIs
============================================================
  nvmlDeviceGetIndex: 0
  nvmlDeviceGetName: MTT S80
  nvmlDeviceGetUUID: 8b92f6da-0f72-1c4f-64d7-594cba05cc7a
  nvmlDeviceGetPciInfo: c_mtmlPciInfo_t(sbdf: 00000000:01:00.0, segment: 0, bus: 1, device: 0, pciDeviceId: 33627861, busWidth: 33627861, pciMaxSpeed: 0.0, pciCurSpeed: 32.0, pciMaxWidth: 1107296256, pciCurWidth: 16, pciMaxGen: 16, pciCurGen: 5, busId: 00000000:01:00.0, rsvd: <pymtml.c_ulong_Array_6 object at 0x000001DEF04E8250>)
  nvmlDeviceGetSerial: [MTMLError: Not Supported]
  nvmlDeviceGetMemoryInfo: NVMLMemoryInfo(total=17179869184, free=15587979264, used=1591889920)
  nvmlDeviceGetUtilizationRates: NVMLUtilization(gpu=0, memory=9)
  nvmlDeviceGetTemperature: 56
  nvmlDeviceGetPowerUsage: 125616
  nvmlDeviceGetFanSpeed: 30
  nvmlDeviceGetClockInfo (Graphics): 1800
  nvmlDeviceGetClockInfo (Memory): 1750
  nvmlDeviceGetClockInfo (Video): [MTMLError: Not Supported]
  nvmlDeviceGetEncoderUtilization: [0, 0]
  nvmlDeviceGetDecoderUtilization: [0, 0]
  nvmlDeviceGetTotalEccErrors: 0

============================================================
 Topology APIs (Skipped - need 2+ devices)
============================================================

============================================================
 Test Complete
============================================================

MTML library shutdown complete.

============================================================
 Init/Shutdown Cycle Test
============================================================
  Cycle 1: Init...
  Cycle 1: Device count = 1
  Cycle 1: Shutdown...
  Cycle 2: Init...
  Cycle 2: Device count = 1
  Cycle 2: Shutdown...
  Cycle 3: Init...
  Cycle 3: Device count = 1
  Cycle 3: Shutdown...
  Init/Shutdown cycle test: PASSED

Linux

Initializing MTML library...

============================================================
 MTML Python Bindings Test Suite
============================================================

============================================================
 Library APIs
============================================================
  Library Version: 2.1.1
  Device Count: 8
  Driver Version: 3.3.5-server
  Free System: OK

Found 8 device(s)

============================================================
 Device 0 - Basic APIs
============================================================
  Index: 0
  Name: MTT S5000
  UUID: 7de4d75b-7522-1fdc-8dc4-db9a169a5e88
  Brand: 0
  Serial Number: MY153K024CX00243
  Power Usage (mW): 408665
  GPU Path: /dev/mtgpu.0
  Primary Path: /dev/dri/card1
  Render Path: /dev/dri/renderD128
  VBIOS Version: 4.3.43
  MtBios Version: 4.3.43
  GPU Cores Count: 8

============================================================
 Device 0 - PCI APIs
============================================================
  PCI Info: c_mtmlPciInfo_t(sbdf: 00000000:2a:00.0, segment: 0, bus: 42, device: 0, pciDeviceId: 67116757, busWidth: 69607125, pciMaxSpeed: 0.0, pciCurSpeed: 32.0, pciMaxWidth: 1107296256, pciCurWidth: 16, pciMaxGen: 16, pciCurGen: 5, busId: 00000000:2a:00.0, rsvd: <pymtml.c_uint_Array_6 object at 0x7fa3eb59a3d0>)
  PCI Info busId populated: 00000000:2a:00.0
  PCIe Slot Info: c_mtmlPciSlotInfo_t(slotType: 2, slotName: Slot 2, rsvd: <pymtml.c_uint_Array_4 object at 0x7fa3eb59a250>)

============================================================
 Device 0 - Fan APIs
============================================================
  Fan Count: 0

============================================================
 Device 0 - Display APIs
============================================================
  Display Interface Count: 0

============================================================
 Device 0 - Property APIs
============================================================
  Device Property: c_mtmlDeviceProperty_t(virtCapability: 272, virtRole: 0, mpcCapability: 0, mpcType: 0, rsvd: <pymtml.c_uint_Array_12 object at 0x7fa3eb59a3d0>)

============================================================
 Device 0 - GPU APIs
============================================================
  GPU Utilization (%): 0
  GPU Temperature (C): 52
  GPU Clock (MHz): 1750
  GPU Max Clock (MHz): [MTMLError: Not Supported]
  Geometry Engine Util (%): 0
  2D Engine Util (%): 0
  3D Engine Util (%): 0
  Compute Engine Util (%): 0

============================================================
 Device 0 - Memory APIs
============================================================
  Total Memory (bytes): 85899345920
  Used Memory (bytes): 2228224
  System Used Memory: [MTMLError: Not Supported]
  Memory Utilization (%): 0
  Memory Clock (MHz): 2500
  Memory Max Clock (MHz): 2500
  Memory Bus Width (bits): 640
  Memory Bandwidth (GB/s): 1600
  Memory Speed (Mbps): 20000
  Memory Vendor: Samsung
  Memory Type: 1

============================================================
 Device 0 - VPU APIs
============================================================
  VPU Clock (MHz): 0
  VPU Max Clock (MHz): 1319
  VPU Utilization: c_mtmlCodecUtil_t(encodeUtil: 0, decodeUtil: 0, rsvd: <pymtml.c_uint_Array_4 object at 0x7fa3eb59a250>)
  Codec Capacity: (31, 279)

============================================================
 Device 0 - MtLink APIs
============================================================
  MtLink Spec: c_mtmlMtLinkSpec_t(version: 20000, bandWidth: 56, linkNum: 14, rsvd: <pymtml.c_uint_Array_4 object at 0x7fa3eb59a250>)
  Link 0 State: 1
  Link 0 Remote Device: <pymtml.LP_struct_c_mtmlDevice_t object at 0x7fa3eb59a250>
  Link 1 State: 1
  Link 1 Remote Device: <pymtml.LP_struct_c_mtmlDevice_t object at 0x7fa3eb59a250>
  Link 2 State: 1
  Link 2 Remote Device: <pymtml.LP_struct_c_mtmlDevice_t object at 0x7fa3eb59a250>
  Link 3 State: 1
  Link 3 Remote Device: <pymtml.LP_struct_c_mtmlDevice_t object at 0x7fa3eb59a250>
  Link 4 State: 1
  Link 4 Remote Device: <pymtml.LP_struct_c_mtmlDevice_t object at 0x7fa3eb59a250>
  Link 5 State: 1
  Link 5 Remote Device: <pymtml.LP_struct_c_mtmlDevice_t object at 0x7fa3eb59a250>
  Link 6 State: 1
  Link 6 Remote Device: <pymtml.LP_struct_c_mtmlDevice_t object at 0x7fa3eb59a250>
  Link 7 State: 1
  Link 7 Remote Device: <pymtml.LP_struct_c_mtmlDevice_t object at 0x7fa3eb59a250>
  Link 8 State: 1
  Link 8 Remote Device: <pymtml.LP_struct_c_mtmlDevice_t object at 0x7fa3eb59a250>
  Link 9 State: 1
  Link 9 Remote Device: <pymtml.LP_struct_c_mtmlDevice_t object at 0x7fa3eb59a250>
  Link 10 State: 1
  Link 10 Remote Device: <pymtml.LP_struct_c_mtmlDevice_t object at 0x7fa3eb59a250>
  Link 11 State: 1
  Link 11 Remote Device: <pymtml.LP_struct_c_mtmlDevice_t object at 0x7fa3eb59a250>
  Link 12 State: 1
  Link 12 Remote Device: <pymtml.LP_struct_c_mtmlDevice_t object at 0x7fa3eb59a250>
  Link 13 State: 1
  Link 13 Remote Device: <pymtml.LP_struct_c_mtmlDevice_t object at 0x7fa3eb59a250>

============================================================
 Device 0 - ECC APIs
============================================================
  ECC Mode: (0, 0)
  Retired Pages Count: c_mtmlPageRetirementCount_t(singleBitEcc: 0, doubleBitEcc: 0, rsvd: <pymtml.c_uint_Array_4 object at 0x7fa3eb59a250>)
  Retired Pages Pending: 0
  ECC Corrected Errors: [MTMLError: Not Supported]
  ECC Uncorrected Errors: [MTMLError: Not Supported]

============================================================
 Device 0 - MPC APIs
============================================================
  MPC Mode: 0
  Supported MPC Profiles Count: [MTMLError: Not Supported]
  Supported MPC Configurations Count: [MTMLError: Not Supported]
  MPC Instances Count: [MTMLError: Not Supported]
  Current MPC Configuration: [MTMLError: Not Supported]

============================================================
 Device 0 - Virtualization APIs
============================================================
  Supported Virt Types Count: [MTMLError: Not Supported]
  Available Virt Types Count: [MTMLError: Not Supported]
  Active Virt Devices Count: [MTMLError: Not Supported]

============================================================
 Device 0 - NVML Wrapper APIs
============================================================
  nvmlDeviceGetIndex: 0
  nvmlDeviceGetName: MTT S5000
  nvmlDeviceGetUUID: 7de4d75b-7522-1fdc-8dc4-db9a169a5e88
  nvmlDeviceGetPciInfo: c_mtmlPciInfo_t(sbdf: 00000000:2a:00.0, segment: 0, bus: 42, device: 0, pciDeviceId: 67116757, busWidth: 69607125, pciMaxSpeed: 0.0, pciCurSpeed: 32.0, pciMaxWidth: 1107296256, pciCurWidth: 16, pciMaxGen: 16, pciCurGen: 5, busId: 00000000:2a:00.0, rsvd: <pymtml.c_uint_Array_6 object at 0x7fa3eb59a850>)
  nvmlDeviceGetSerial: MY153K024CX00243
  nvmlDeviceGetMemoryInfo: NVMLMemoryInfo(total=85899345920, free=85897117696, used=2228224)
  nvmlDeviceGetUtilizationRates: NVMLUtilization(gpu=0, memory=0)
  nvmlDeviceGetTemperature: 52
  nvmlDeviceGetPowerUsage: 408681
  nvmlDeviceGetFanSpeed: 0
  nvmlDeviceGetClockInfo (Graphics): 1750
  nvmlDeviceGetClockInfo (Memory): 2500
  nvmlDeviceGetClockInfo (Video): 0
  nvmlDeviceGetEncoderUtilization: [0, 0]
  nvmlDeviceGetDecoderUtilization: [0, 0]
  nvmlDeviceGetTotalEccErrors: 0

###########################
Omitted test results for other 7 devices...
###########################

============================================================
 Topology APIs
============================================================
  Topology Level (dev0, dev1): 4
  P2P Status Read: 0
  P2P Status Write: 0

============================================================
 Test Complete
============================================================

MTML library shutdown complete.

============================================================
 Init/Shutdown Cycle Test
============================================================
  Cycle 1: Init...
  Cycle 1: Device count = 8
  Cycle 1: Shutdown...
  Cycle 2: Init...
  Cycle 2: Device count = 8
  Cycle 2: Shutdown...
  Cycle 3: Init...
  Cycle 3: Device count = 8
  Cycle 3: Shutdown...
  Init/Shutdown cycle test: PASSED

This was referenced Mar 10, 2026
@yeahdongcn yeahdongcn merged commit 1282846 into MooreThreads:main Mar 10, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants