System info and memory measurement are not accurate on certain Apple devices
- Dominant language
- C++
- Stars
- 11
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
## Symptoms
### System info detection
On a M4 Max with 48GB running macOS 15.5 (Build 24F69), it detects such information
```
XPUInfo detected 1 devices
XPUInfo[Index=0, LUID=0x100000476]:
Name: Apple M2 Max
Driver Version: 15.0.0.0
Type: GPU, Integrated
Memory (MB): Dedicated = 0, Shared = 73728
APIs: Metal, Deserialized
CPU: Apple M2 Max
Cores: 12 (Hybrid)
Logical: 12
System Memory:
Installed Physical Memory (GB): 96
Total Physical Memory (GB): 96
Available Physical Memory At Init (GB): 1.7671
Page Size (KB): 16
System Information:
Manufacturer: Apple
Model: Mac14,13
TotalPhysicalMemory (GB): 96
OS: macOS Version 15.0 (Build 24A331), Build 15.0.0 (Build 24A331)
Uptime (Days): 29
```
Testing on other devices is in progress.
### Unclear meaning of GPU memory
Reported GPU memory usage has unclear meaning for hardware on Apple Silicon which has unified memory. More useful abstraction might be needed for such cases.
## Preliminary investigation
1. Device Name: "Apple M2 Max" instead of "Apple M4 Max"
This misinformation seems from
https://github.com/intel/LibXPUInfo/blob/e85d1f21d7d80ab355d5e8c44e3c9f69fd5e982a/LibXPUInfo_Metal.mm#L203
2. Memory Issues: 48GB system shows as 96GB total, 73728MB shared
seems from
https://github.com/intel/LibXPUInfo/blob/e85d1f21d7d80ab355d5e8c44e3c9f69fd5e982a/LibXPUInfo_Metal.mm#L148
3. OS Version: macOS 15.0 instead of 15.5
seems from
https://github.com/intel/LibXPUInfo/blob/e85d1f21d7d80ab355d5e8c44e3c9f69fd5e982a/LibXPUInfo_Metal.mm#L139
and
https://github.com/intel/LibXPUInfo/blob/e85d1f21d7d80ab355d5e8c44e3c9f69fd5e982a/LibXPUInfo_Metal.mm#L189
4. GPU memory measurement
For each device in the detected device vector, LibXPUInfo measures a memory budget struct like this
https://github.com/intel/LibXPUInfo/blob/e85d1f21d7d80ab355d5e8c44e3c9f69fd5e982a/LibXPUInfo.h#L186-L192
It's implementation for Metal device is as
https://github.com/intel/LibXPUInfo/blob/e85d1f21d7d80ab355d5e8c44e3c9f69fd5e982a/LibXPUInfo_Metal.mm#L86-L128
We may want to align on how to repurpose this per-device measurement for it to convey more meaningful info (such as memory access patterns), and then clarify on the correct implementation for it.
Contributor guide
Assessment
This issue has not been assessed yet.