Discussion:
Espresso (Nintendo Wii U) SMP build support
Add Reply
Lennart Sorensen
2025-02-25 13:00:01 UTC
Reply
Permalink
Hello all,
What would it take to have a debian build for the Espresso (Nintendo Wii U) CPU?
Currently, due to overall Espresso weirdness, both GCC and glibc need to be patched for any applications to take advantage of all three cores. This means every application and library needs to be patched to be able to support smp on the Wii U. Debian powerpc will currently run on the Wii U, but due to the lack of patches, you are stuck with only a single core, and performance is extremely hampered by that. Adelie Linux currently has support for the Wii U, but it would be great to have a debian build.
The Wii U has three cores and 2GB of RAM, so it's relatively powerful machine for the price (you can find them for around $25 online). I'm also able to provide access to multiple if needed.
The smp patches are available here: https://gitlab.com/linux-wiiu/smp-patches
Currently, there is not a patch for LLVM, so any applications that are built with clang will not run on an smp-patched build.
Any input is appreciated!
That looks like it would have a performance impact on all other users.
Doing a cache flush on every atomic load and store?

So I would think that means distributions would not want to include that
in a normal build, so a custom build of anything you wanted to run would
be needed. If you had a decently fast powerpc machine you could setup
some scripts to rebuild all the packages. It would take a while depending
on the speed of the build machine.
--
Len Sorensen
John Paul Adrian Glaubitz
2025-02-25 13:10:01 UTC
Reply
Permalink
Hello Kurt,
What would it take to have a debian build for the Espresso (Nintendo Wii U) CPU?
Currently, due to overall Espresso weirdness, both GCC and glibc need to be patched
for any applications to take advantage of all three cores. This means very application
and library needs to be patched to be able to support smp on the Wii U. Debian powerpc
will currently run on the Wii U, but due to the lack of patches, you are stuck with only
a single core, and performance is extremely hampered by that. Adelie Linux currently
has support for the Wii U, but it would be great to have a debian build.
I think it would be more reasonable to work on the kernel and glibc such that rebuilding
all packages with a patched compiler should not be necessary. Given the very low user
base, I don't think it would be justified to bootstrap a completely new Debian port
for the Wii U.
The Wii U has three cores and 2GB of RAM, so it's relatively powerful machine for the
price (you can find them for around $25 online). I'm also able to provide access to
multiple if needed.
The hardware isn't really the issue but the amount of work needed to maintain such a
port. Such an endeavor would only be justified if the number of users is high enough.
The smp patches are available here: https://gitlab.com/linux-wiiu/smp-patches
Wouldn't it be possible to upstream these? And do we really need to rebuild all packages
to make use of all cores of the Wii U CPU?
Currently, there is not a patch for LLVM, so any applications that are built with clang
will not run on an smp-patched build.
Any input is appreciated!
If there is really no way other than rebuilding all packages, I would suggest using a
source-based distribution such as Gentoo.

Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Lennart Sorensen
2025-02-25 21:10:01 UTC
Reply
Permalink
I agree, there's no reason to penalize normal ppc users with the patch. It's why I'm suggesting a separate port/repo with Espresso SMP support.
Well someone would have to build and maintain it. It seems hard enough to
even get that for powerpc and ppc64, never mind a really niche platform.

I wonder if there would be a way to scan the existing binaries looking
for the instruction to see if some packages might be able to be used
without rebuilding. Might not be very many though given probably any
code with threads in it would be affected.

I must admit today was the first time I had even heard of linux running
on the Wii U. I knew it had a powerpc chip in it, but I figured nintendo
likes to lock down their hardware.
--
Len Sorensen
Athanasios Anastasiou
2025-02-26 11:00:01 UTC
Reply
Permalink
Hi

I have noticed the same about the Wii and agree that it would be great to
have Debian on it. But I can also see the point o

If we are talking about taking advantage of SMP (?), the kernel is supposed
to do this automatically by balancing computations across all CPUs.
Therefore, presumably, only the kernel would have to be compiled with any
additional effort.
Except if I am missing something here, is the Wii's CPU instruction set
deviating from the Powerpc standard in some particular way that it would
require recompiling a whole program?

Just out of curiosity, which instruction are you referring to in "...scan
the existing binaries looking for the instruction..."?

All the best
Well someone would have to build and maintain it. It seems hard enough to
even get that for powerpc and ppc64, never mind a really niche platform.
It would essentially be the same as the powerpc port, except that
everything is compiled with the smp gcc patches. Everything built with the
smp-patched GCC should also run fine on a non-Wii U PPC32 devices, so any
test suites wouldn't have to change.
I wonder if there would be a way to scan the existing binaries looking
for the instruction to see if some packages might be able to be used
without rebuilding. Might not be very many though given probably any
code with threads in it would be affected.
It's possible that some applications could work, but I doubt the effort of
searching would be worth it.
I must admit today was the first time I had even heard of linux running
on the Wii U. I knew it had a powerpc chip in it, but I figured nintendo
likes to lock down their hardware.
Linux was initially ported to the Wii U back in 2018. Nintendo does like
to lock down their hardware, but that hasn't stopped people from hacking
it. It just so happens that it's really simple to hack the Wii U to boot
Linux on it. If you've got $30-40 and twenty minutes of free time, I
recommend getting one and trying it out at some point :D
-- Kurt
Lennart Sorensen
2025-02-26 20:50:01 UTC
Reply
Permalink
Post by Athanasios Anastasiou
Hi
I have noticed the same about the Wii and agree that it would be great to
have Debian on it. But I can also see the point o
If we are talking about taking advantage of SMP (?), the kernel is supposed
to do this automatically by balancing computations across all CPUs.
Therefore, presumably, only the kernel would have to be compiled with any
additional effort.
Except if I am missing something here, is the Wii's CPU instruction set
deviating from the Powerpc standard in some particular way that it would
require recompiling a whole program?
Just out of curiosity, which instruction are you referring to in "...scan
the existing binaries looking for the instruction..."?
All the best
Unfortunately it appears a mistake in the CPU means the instructions
used on powerpc for atomic locking don't work on the Wii due to it not
automatically synching caches between cores. This means you can't fix it
in the kernel. You literally need to make every piece of code using those
instructions insert a cache sync instruction before the atomic operation.
I guess Nintendo dealt with that in the compiler in the SDK for the Wii U,
so it wasn't really an issue there.

As a general purpose powerpc CPU, this thing could never have been
shipped in that state. But it wasn't a general purpose powerpc CPU.
--
Len Sorensen
Loading...