Dr-Noob / cpufetch

Simple yet fancy CPU architecture fetching tool
GNU General Public License v2.0
1.88k stars 103 forks source link

`[ERROR]: Unknown microarchitecture detected: 0x70010201` on Nintendo Wii U [PowerPC] #231

Closed WiiNewU closed 1 month ago

WiiNewU commented 6 months ago

CPUfetch cant recognize the Nintendo Wii U's SOC, called "Espresso", made by IBM. Its a 32bit PowerPC BE CPU.

CPUfetch running on Wii U (Espresso)

$ cpufetch --debug
cpufetch v1.05-6-g2976 (Linux PowerPC build)
PVR: 0x70010201

This is running on the unofficial 32bit PPC port of Debian trixie/SID. Uses Linux kernel 4.19.265-wiiu-gf5f64b59fada .

This is a output of/proc/cpuinfo:

processor   : 0
cpu     : Espresso
clock       : 1243.125000MHz
revision    : 2.1 (pvr 7001 0201)
bogomips    : 124.31

timebase    : 62156250
platform    : wiiu
model       : nintendo,wiiu
Memory      : 2304 MB

This is a output of lscpu:

Architecture:        ppc
CPU op-mode(s):      32-bit
Byte Order:          Big Endian
CPU(s):              1
On-line CPU(s) list: 0
Model name:          Espresso
Model:               2.1 (pvr 7001 0201)
Thread(s) per core:  1
Core(s) per socket:  1
Socket(s):           1
BogoMIPS:            124.31
L1d cache:           32 KiB (1 instance)
L1i cache:           32 KiB (1 instance)
L2 cache:            512 KiB (1 instance)
Dr-Noob commented 4 months ago

Wow! It is great to see cpufetch running on the Wii U! I have added preeliminary support in the wiiu branch. Can you have a look and see if it works?

It is probably not the most elegant solution, since Espresso seems to be based on PowerPC 750L, but currently cpufetch does not support PowerPC 7xx at all. Ideally, I will add support for this and then make Espresso a special case inside the PowerPC 750L microarchitecture. If you have any feedback about this please feel free to share it.

The number of cores seems to be 3, although cpufetch won't see it. This seems to be because of incomplete Linux support. If you have the time you can post the output of /proc/cpuinfo and maybe we can figure out where is the problem.

WiiNewU commented 4 months ago

@Dr-Noob Hi, thank you for updating, I compiled and ran cpufetch from the wiiu branch and its a lot more detailed and no longer gives the error message at the top.

cpufetch-wiiu-May18th2024-exe

I also ran /proc/cpuinfo but it gives the same output as before, cpufetch-wiiu-May18th2024-cpuinfo

The reason why only one core shows up is due to a limitation imposed by the Wii U Linux kernel developers, they say on there gitlab page that while multi core/SMP is possible, it will break the existing Linux userspaces. Its likely out of our control for the multi core part. Some thing like saying "3 cores, 1 active" or "3 cores, 2 disabled" may be a good work around.

Thank you for your project!

Source for lack of multicore: https://gitlab.com/linux-wiiu/linux-wiiu/-/blob/rewrite-4.19/README.md

This is also a good source for learning about the Wii U CPU: https://www.copetti.org/writings/consoles/wiiu/#cpu

Dr-Noob commented 1 month ago

Hi, I have pushed a new fix. Can you run cpufetch --verbose with the new fix to see if it helps?

WiiNewU commented 1 month ago

Hi @Dr-Noob , This is the output:

wiiu@archU:~$ cpufetch --verbose [WARNING]: Could not open '/proc/device-tree/vpd/root-node-vpd@a000/enclosure@1e00/backplane@800/processor@1000/part-number' [WARNING]: Could not open '/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq' [WARNING]: Could not open '/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq' [WARNING]: fill_package_ids_from_sys: package_ids[0] = -1 [WARNING]: fill_package_ids_from_sys failed, output may be incomplete/invalid [WARNING]: Could not open '/sys/devices/system/cpu/cpu0/topology/package_cpus' [WARNING]: get_num_sockets_package_cpus failed: assuming 1 socket [WARNING]: Could not open '/sys/devices/system/cpu/cpu0/cache/index3/size'

                                                          Microarchitecture:   Espresso
                                                          Technology:          45nm
                                                          Max Frequency:       1.243 GHz
                                                          Cores:               1 cores
                                                          Altivec:             No
                                                          L1i Size:            32KB
                                                          L1d Size:            32KB
                                                          L2 Size:             512KB
                                                          Peak Performance:    1.24 GFLOP/s

wiiu@archU:~$

The IBM logo still shows up fine.

Dr-Noob commented 1 month ago

Yeah, assuming 1 socket makes more sense that just giving up if there is no way to detect it.

The output looks good to me right now. I have merged this into main, thanks for the feedback :+1: