ZLUDA icon indicating copy to clipboard operation
ZLUDA copied to clipboard

Migrate to C/C++ for embedded systems

Open GermanAizek opened this issue 1 year ago • 7 comments
trafficstars

Does anyone have plans to rewrite this in C++ or C for integration into embedded devices?

GermanAizek avatar Feb 13 '24 15:02 GermanAizek

Why... that would be going backwards for no reason. It's written in rust that doesn't stop you from running it on any embedded device that can also run a GPU.

cb88 avatar Feb 13 '24 15:02 cb88

Why... that would be going backwards for no reason. It's written in rust that doesn't stop you from running it on any embedded device that can also run a GPU.

is it possible to run it on OpenWRT with MIPS32 24Kc architecture, for example?

https://forum.openwrt.org/t/installing-rust-compiler-on-openwrt/182937/5

in short:

$ ./rustup-init.sh
info: downloading installer
Warning: Not enforcing strong cipher suites for TLS, this is potentially less secure
curl: (22) The requested URL returned error: 404
rustup: installer for platform 'riscv64gc-unknown-linux-musl' not found, this may be unsupported

on doc.rust-lang.org i find toolchains, but I didn't find any for MIPS32 and RISCV64. Most likely they have not been written yet.

image

GermanAizek avatar Feb 13 '24 16:02 GermanAizek

What hardware are you talking about because MIPS32 is pretty much dead?

The RISCV64 system can work already just pick a distro that uses GLIBC instead of MUSL and call it a day. It's a tier 2 platform with essentially full support.

In any case the real gottcha is probably not even rust but ROCm...

cb88 avatar Feb 13 '24 17:02 cb88

What embedded device has a modern AMD GPU? Just curious

nonetrix avatar Feb 14 '24 02:02 nonetrix

What hardware are you talking about because MIPS32 is pretty much dead?

@cb88, Since when has it stopped being supported, most switches, firewalls and routers are based on this architecture. You probably have only one live platform, it's x86-64, Rust really still can't compile for MIPS32 and RISCV64, what you're offering is just not working snapshot toolchain.

GermanAizek avatar Feb 14 '24 10:02 GermanAizek

@GermanAizek Again... Both MIP 32 LE and RISCV64 have supported toolchains. MIPS32 LE you have to build yourself just like any other embedded toolchain, and they provide prebuilt RISCV64 toolchains for a common toolchain version using GLIBC where ROCm will also work.... MUSL is not a common c library for this type of software. If you can't build your own embedded toolchains thats a you problem not something you should blame on others.

I guarantee you ROCm doesn't build on MUSL either in fact there are closed bug reports about it not working (closed without adding support).

And you still haven't referenced a realistic device where you would be connecting a GPU to a MIPS32 CPU... I'm certainly not aware of any.

cb88 avatar Feb 14 '24 17:02 cb88

your embedded devices have GPUs?

Kreijstal avatar Feb 15 '24 11:02 Kreijstal