How to play with a RiscV version of Haiku in TinyEMU or QEMU?

I suspect it will take days, not hours. And it may need to fix small build failures and start again several times.

Building LLVM takes half of day even on modern x86 hardware.

I’m confused. It DOES exist, but it takes forever to build? Or it WOULD take forever to build, if it DID exist? Can the RISC V version of LLVM be compiled on a non-RISCV Haiku system (like the way I created a version of Haiku (RISC V) on my current x86_64 version of Haiku) or does it have to be compiled in a RISC V version of Haiku?

Like I said, time is not the concern (for me). I just want to be able to do it, period. The speed will come as it’s refined. So, where do I go to get it and what do I need to do, to start compiling it?

Currently Haiku LLVM riscv64 builds don’t exist, at least as I know. Last time I tried, it were stability bugs that prevented scenario “start build and let it alone several days”. Now stability bugs are hopefully fixed and LLVM build attempts can be resumed. But I don’t want to do it now, I am doing different things with RISC-V hardware.

It can’t be done by regular HaikuPorts recipe because HaikuPorter don’t support cross compile yet. In theory LLVM can be crosscompiled without using HaikuPorter and then packaged into HPKG manually.

Hey, it’s all cool. I’m loving the progress you’re making with Haiku Risc V. I’m just trying to get my hands on as much stuff as I can for this new platform, to tinker with.

To that end, how do I enable multi-core in QEMU for Haiku Risc V? I’d read that it’s possible now, but I don’t know what is required, to do so. Is it simply part of the QEMU command line or is it something that needs to be enabled in the Haiku (Risc V) build?

Add -smp 4 (or another CPU core count instead of “4”) to QEMU command options.

Does Mesa (OpenGL substitute) exist at all for Haiku (RiscV) yet or does it require LLVM to compile? Is there some kinda work-around (an older version of Mesa or something) that would give us something to play with? I’d be happy if I could just watch the GL spinning gears or something! :grin: I’ve seen screenshots of it being made available, but that was something to do with Vulkan/LLVM, so I may be barking up the wrong tree, as it were. :grin:

Mesa OpenGL software rendering depends on LLVM. Mesa Vulkan software rendering and SwiftShader depend on LLVM too.

1 Like

So, basically, ANYTHING to do with Mesa or Vulkan requires LLVM. Bummer. No work around. Oh, well… LT.LGO (Life’s Tough. Life Goes On). Just gonna hafta wait… patiently.

Also, interesting to note… I tried -smp 4 and it crashed to the Haiku Boot Loader (I say, “crashed”, because I couldn’t DO anything in it) in the Terminal. However, when I use -smp 2 or -smp 3, it starts fine… 2 or 3 cores bouncing up and down like happy babies! :rofl:

I have a 2 core, 4 thread Pentium G[number] processor (Kabylake) in my current machine. So, if it’s able to handle -smp 3, it’s obviously not limited to JUST the actual cores of the processor. Unless the emulated RiscV CPU is what is causing the crash. What model of RiscV processor is QEMU emulating in this situation?

Hmm… I know at one time we were using Mesa3D with Softpipe, not LLVM. Softpipe uses Gallium (or the other way around). As Haiku (RiscV) doesn’t have ANY version of Mesa3D right now, it wouldn’t matter which revision of Mesa3D we used… including an absolutely obsolete version. As it is, the ATI Rage 128 chipset is no longer supported in Mesa3D, so we HAVE to go to an older version, just to be able to have Mesa3D at all, in the RiscV version (at least, in the QEMU environment, which only supports the ATI Rage 128 chipset).

How hard would it be to get an OLD (ATI Rage 128 supporting) version of Mesa3D (that uses Softpipe/Gallium) for Haiku (RiscV) compiled? I’m assuming we still can get it. But not sure how or where.

Well, I finally found this:

This thing use LLVM.

“This thing…” being what I just found or what is currently being worked on for Haiku (RiscV)? As I understand it, if LLVM is not specified in the build, it defaults to softpipe (or swpipe, in a worst case?), but…

softpipe and llvmpipe are the same thing and it use LLVM.

So, you’re saying that EVERY version of Mesa3D that has EVER existed for Haiku, has ALWAYS used LLVM?

I find this hard to believe. However, I also just found this… seems to clearly mention swrast, not softpipe or LLVM:

Now, versions more recent, also in that repository, DO mention LLVM… but not this one.

Which means, at some point in the past, Haiku was NOT using LLVM to build Mesa3D. The performance may have stunk, but it ran. I assume.

In my “Learning Adventure”, I’m wondering what other apps or code can be compiled that would run in Haiku (RiscV) in QEMU. What, exactly, is required to make an app build… jam. Or make. Or… whatever. :rofl:

Does the compiler (Jam or whatever) do all the “rearranging”, to make an app work in Haiku (RiscV) or do you actually have to change a portion of the source code in an app, to make it compile for Haiku (RiscV)?

I would be very interested to see if you could compile Digger (the old SDL1 version from digger.org or the SDL2 version from GitHub - sobomax/digger: Classical game of Digger, digitally remastered and enhanced) on RiscV.
Here’s hoping for a Risc-V PC revolution, with Haiku as the most popular OS :rofl:

Just found this… fascinating:

Continuing the discussion from How to play with a RiscV version of Haiku in TinyEMU or QEMU?:

No. Only in reference to Gallium LLVMpipe > Mesa 7.9.2 (<= OpenGL 2.1).

“The Gallium LLVMpipe (i.e. softpipe) driver is a software rasterizer that uses LLVM to do runtime code generation. Shaders, point/line/triangle rasterization and vertex processing are implemented with LLVM IR which is translated to x86, x86-64, or ppc64le machine code. Also, the driver is multithreaded to take advantage of multiple CPU cores (up to 32 at this time).” - LLVMpipe — The Mesa 3D Graphics Library latest documentation

Otherwise, look for GL implementations not using LLVM (or just wait until someone/you do the additional porting work for Haiku RISCV…

Remember, you are in control of your own implementation work…

I wonder what it would take to get SDL2 working for Haiku (RiscV). That “game” I just found would be fun to play. More Googly diggin’, I guess! Or something… :rofl: