!xmLtiCaAJxfhURjrXl:matrix.org

NixOS RISC-V

234 Members
NixOS on RISC-V https://wiki.nixos.org/wiki/RISC-V https://pad.lassul.us/NixOS-riscv64-linux https://github.com/orgs/NixOS/teams/risc-v68 Servers

Load older messages


SenderMessageTime
4 Apr 2024
@thefossguy:matrix.orgPratham Patel (you can mention me)The "v2" of C920 is supposed to be more compliant with the spec but no one has had hands-on with it yet.09:38:48
@shalokshalom:kde.org@shalokshalom:kde.org joined the room.10:05:05
@shalokshalom:kde.org@shalokshalom:kde.orgHi there. I heard about the attempts to bootstrap the GHC on NixOS RISC-V. I guess you tried the LLVM backend? Sorry if thats a bit naive, I guess there is a very good reason, why this wouldnt work. The Github ticket around this issue also mentions, that this is possible. Is the backend not capable to compile itself?10:31:29
@shalokshalom:kde.org@shalokshalom:kde.org * Hi there. I heard about the attempts to bootstrap the GHC on NixOS RISC-V. I guess you tried the LLVM backend? Sorry if thats a bit naive, I guess there is a very good reason, why this wouldnt work. The Github ticket around this issue also mentions, that this is possible. Is the LLVM backend not capable to compile GHC?10:32:42
@shalokshalom:kde.org@shalokshalom:kde.orgI do see the GraalVM also as a potential tool to bootstrap Haskell on RISC-V, although I havent tried that yet. They provide both JIT and compiled (they call it native image) methods to run on RISC-V, and Haskell supposedly runs on it with the Sulong implementation. Just wanted to drop it, in case someone didnt knew about that yet (sorry if obviously not helpful, as said.) 10:37:16
@skeuchel:matrix.orgSteven KeuchelYou can always build GHC with an unregisterised backend (via C), and use that to bootstrap. But that is painfully slow. There is no NCG backend and not runtime linker yet, but that's in progress. The LLVM backend "works" as of 9.6 (or 9.4 with newer llvm like in debian).10:39:52
@eyjhb:eyjhb.dk@eyjhb:eyjhb.dk joined the room.11:21:01
@alex:tunstall.xyzAlex
In reply to @skeuchel:matrix.org
You can always build GHC with an unregisterised backend (via C), and use that to bootstrap. But that is painfully slow. There is no NCG backend and not runtime linker yet, but that's in progress. The LLVM backend "works" as of 9.6 (or 9.4 with newer llvm like in debian).

In my testing using an unregisterised boot GHC, it usually takes around 20 hours to natively build GHC on the JH7110 SoC. Longer if other builds are running in parallel (I've had one GHC build take ~35 hours).

I can't comment on how much faster registerised via LLVM is because my registerised builds keep segfaulting...

12:19:51
@skeuchel:matrix.orgSteven KeuchelHere are my estimates On the pioneer: Unregisterised release+profiled_libs: >30h Unregisterised quick+no_profiled_libs: 18h Registerised release+profiled_libs: 12h Registerised quick+no_profiled_libs: 9h Using qemu user-mode Registerised release+profiled_libs: 8h Registerised quick+no_profiled_libs: 6h 12:24:11
@alex:tunstall.xyzAlex

GHC is quite tricky to compile, so I'd be pleasantly surprised if Sulong were capable of handling it.

Historically, using Hugs to run GHC on itself has been an option, but AFAIK Hugs doesn't support 64-bit ISAs and it also has a relatively low limit on program size that makes bootstrapping GHC even on x86 a nightmare. I don't know what it would take to support RV64GC and I haven't explored patching Hugs to raise the program size limitations.

12:24:58
@alex:tunstall.xyzAlexAlso Hugs requires an ancient version of GCC.12:25:47
@alex:tunstall.xyzAlex

Looking into Sulong, apparently it's not a Haskell compiler/interpreter but an LLVM bitcode interpreter?

That doesn't seem suitable for compiling GHC (Haskell code) from source.
LLVM bitcode isn't the problem here.

12:29:37
@shalokshalom:kde.org@shalokshalom:kde.org Graal and Sulong are able to produce a native image of Haskell code 12:41:42
@shalokshalom:kde.org@shalokshalom:kde.org Graal provides two runtimes: JVM and Truffle. Sulong is the LLVM implementation on Truffle 12:42:09
@shalokshalom:kde.org@shalokshalom:kde.org Hugs is even older than Eta, so I doubt very much it can compile any modern Haskell code at all? 12:42:35
@thefossguy:matrix.orgPratham Patel (you can mention me)
In reply to @skeuchel:matrix.org
Here are my estimates

On the pioneer:
Unregisterised release+profiled_libs: >30h
Unregisterised quick+no_profiled_libs: 18h
Registerised release+profiled_libs: 12h
Registerised quick+no_profiled_libs: 9h

Using qemu user-mode
Registerised release+profiled_libs: 8h
Registerised quick+no_profiled_libs: 6h

Yeah, the multi-core interconnects are only present to connect the cores, not much more. i.e. not how 64-cores are interconnected on threadrippers/eypcs;

So here, qemu-emulation on x86 will be faster tbh

12:43:10
@skeuchel:matrix.orgSteven Keuchel
In reply to @thefossguy:matrix.org

Yeah, the multi-core interconnects are only present to connect the cores, not much more. i.e. not how 64-cores are interconnected on threadrippers/eypcs;

So here, qemu-emulation on x86 will be faster tbh

Most of the stuff I compile is quicker on the pioneer than user-mode emulations, so there's still something GHC-specific to it. Compiling w/o ilbnuma? Larger caches on x86? More "symbolic computations" in comparison to gcc?
12:57:44
@thefossguy:matrix.orgPratham Patel (you can mention me)There's obviously a lot of moving parts to this :)12:58:43
@thefossguy:matrix.orgPratham Patel (you can mention me)What I meant to say was, you're not actually using all 64-cores on the pioneer "efficiently" because the interconnects aren't well. It's a first gen product. Impressive that they could even pull it off, a first gen product nonetheless.12:59:42
@alex:tunstall.xyzAlex
In reply to @shalokshalom:kde.org
Hugs is even older than Eta, so I doubt very much it can compile any modern Haskell code at all?
It doesn't need to. It only needs to be able to interpret an old version of GHC, then the build can work its way up to a modern GHC.
13:43:26
@shalokshalom:kde.org@shalokshalom:kde.org Yeah, true. 14:03:45
@shalokshalom:kde.org@shalokshalom:kde.org Well then, Eta might be a choice. It has a native Haskell compiler for 7 and even some features of 8, probably better than Hugs 🤷 14:05:07
@rtunreal:c-base.orgrtunreal joined the room.15:23:24
@jopejoe1:matrix.orgjopejoe1 (4094@epvpn) joined the room.16:22:35
@hive:the-apothecary.clubhive ⬡Redacted or Malformed Event18:06:30
@hive:the-apothecary.clubhive ⬡sorry not what i meant to post18:06:52
@hive:the-apothecary.clubhive ⬡i finally got a build failure that was just tests18:07:10
@hive:the-apothecary.clubhive ⬡this is going to make things difficult,,,18:07:19
@hive:the-apothecary.clubhive ⬡catch2-3.5.2-riscv64-linux18:07:20
@sorear:matrix.orgsorear

the C910 has two classes of issues:

  1. non-standard features for things that eventually became standard, i.e. RVV 0.7.1, MAEE instead of Svpbmt (needed for PCIe because Intel didn't distinguish BARs by memory type, irrelevant otherwise), T-Head performance counters, etc. None of this affects software that doesn't opt in to using the pre-standard feature, and none of it is morally different from any other non-standard extension, which are likely to be ubiquitous
  2. ordinary bugs - unreasonably slow contended memory access without fences, wrong decoding of noncanonical fences, wrong FP underflow flag - there is no reason to believe that future, more complicated cores will have fewer total bugs, even if they fix the current bugs, and also no evidence that the C910's crop of bugs can cause successful builds with miscompilations
18:24:49

Show newer messages


Back to Room ListRoom Version: 10