Skip to content

RISC-V support #36748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mattgenious opened this issue May 20, 2020 · 87 comments
Open

RISC-V support #36748

mattgenious opened this issue May 20, 2020 · 87 comments
Labels
arch-riscv Related to the RISC-V architecture area-VM-meta-mono help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@mattgenious
Copy link

Posting because I cannot find mention anywhere

I have seen that mono supports the RISC-V architecture but cannot find anything relating to .NET 5 support for RISC-V.
Are there any plans to support said architecture on future releases of .NET like ARM64 has been added?

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Meta untriaged New issue has not been triaged by the area owner labels May 20, 2020
@joperezr joperezr added question Answer questions and provide assistance, not an issue with source code or documentation. and removed untriaged New issue has not been triaged by the area owner labels Jul 7, 2020
@joperezr
Copy link
Member

joperezr commented Jul 7, 2020

cc: @marek-safar

@joperezr joperezr added this to the Future milestone Jul 7, 2020
@DavidBurela
Copy link

SiFive just announced a new powerful RISC-V development board coming out this year. Will be a number of new developers using the hardware. Might be worth looking at RISC-V support again, especially in IoT scenarios.

https://www.sifive.com/blog/the-heart-of-risc-v-development-is-unmatched
https://www.sifive.com/boards/hifive-unmatched

@logicethos
Copy link

The First Affordable RISC-V Computer Designed to Run Linux
https://beaglev.seeed.cc/

Also the Allwinner RISC-V chip to set to debut on $13 Linux hacker board soon.

@broudy3
Copy link
Contributor

broudy3 commented Jan 16, 2021

I assume that libunwind needs to be ported first to RISC-V, as coreclr depends on this library. Is this statement true? There is a closed port request libunwind/libunwind#99

@0xStuart
Copy link

The BL602 is gaining popularity. It's an alternative to the hugely popular ESP32 which is everywhere.
RISC-V with Wifi and Bluetooth

@ghost ghost added the needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration label Mar 24, 2021
@joperezr joperezr removed the needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration label Mar 31, 2021
@archanox
Copy link

archanox commented Jul 7, 2021

I assume that libunwind needs to be ported first to RISC-V, as coreclr depends on this library. Is this statement true? There is a closed port request libunwind/libunwind#99

It looks like the support has been merged in upstream now.

@ghost ghost added the needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration label Jul 7, 2021
@alexrp
Copy link
Contributor

alexrp commented Jul 7, 2021

Just noticed this issue and wanted to clarify something:

I have seen that mono supports the RISC-V architecture

For the record, "supports" is an overstatement here. IIRC, you can just barely run 'hello world' with the interpreter, and not much more. The JIT backend for RISC-V is like 10% done at most. There's a lot of work to be done for Mono's RISC-V support to actually be usable.

@archanox
Copy link

archanox commented Jul 7, 2021

You're definitely right @alexrp.
I've been trying to build mono on my RISC-V hardware for a little while now with no success.
I've noticed that there is a bit of a to do list here mono:mono/docs/riscv.md

If I can get it to build, I'd be very keen to contribute to getting the mono support working, which if I understand correctly is the first step in getting .net vanilla support?

@advancedwebdeveloper
Copy link

I shall give a try

@archanox
Copy link

I've thrown this up on gitpay to try and attract developers to perform this work https://gitpay.me/#/task/607

@archanox
Copy link

And bountysource https://app.bountysource.com/issues/98479258-risc-v-support

@marek-safar marek-safar removed the question Answer questions and provide assistance, not an issue with source code or documentation. label May 13, 2022
@clamp03
Copy link
Member

clamp03 commented Feb 29, 2024

@gbalykov @bartlomiejko Thank you.

@BruceForstall
Copy link
Contributor

@clamp03 Based on the above, I updated the @dotnet/samsung group as follows:

Removed @leemgs @idkiller @myungjoo @jyoungyun @sjsinju
Added @JongHeonChoi @denis-paranichev @o-lek

I could not add @rzsc because they are not a member of the dotnet org. I believe @jkotas has sent them an invite.

Note that @denis-paranichev @o-lek @rzsc GitHub profiles do not indicate they are affiliated with Samsung.

@Xinlong-Wu
Copy link
Contributor

Xinlong-Wu commented Mar 7, 2024

If you don't mind, could you add our developers to dotnet org

hi @BruceForstall, same thing, I would be greatful if you can add me to dotnet org.

@jkotas
Copy link
Member

jkotas commented Mar 8, 2024

@Xinlong-Wu We have added the folks above so that we can include them in dotnet samsung team that we have been working with closely for a long time and the team alias is convenient for github workflows. We do not add folks to the dotnet org without a demonstrated need.

@vargaz
Copy link
Contributor

vargaz commented Mar 8, 2024

@Xinlong-Wu has been contributing riscv support for mono.

@jkotas
Copy link
Member

jkotas commented Mar 8, 2024

I appreciate @Xinlong-Wu contributions. dotnet org membership is not required for contributing. It is only needed for membership in a dotnet org team alias or to grant additional permissions.

@clamp03
Copy link
Member

clamp03 commented Mar 8, 2024

@clamp03 Based on the above, I updated the @dotnet/samsung group as follows:

Removed @leemgs @idkiller @myungjoo @jyoungyun @sjsinju Added @JongHeonChoi @denis-paranichev @o-lek

I could not add @rzsc because they are not a member of the dotnet org. I believe @jkotas has sent them an invite.

Note that @denis-paranichev @o-lek @rzsc GitHub profiles do not indicate they are affiliated with Samsung.

Thank you so much!!!!!
@rzsc Please check your email inbox. (@bartlomiejko Could you please let him know?)

@rzsc
Copy link
Contributor

rzsc commented Mar 8, 2024

I have turned on two-factor authentication and accepted invitation to the @dotnet organization. Is anything more I need to do, please?

@BruceForstall
Copy link
Contributor

@rzsc I have added you to the https://github.com/orgs/dotnet/teams/samsung team.

@ivanjx
Copy link

ivanjx commented Apr 7, 2024

is native aot for risc-v also covered here?

@raffaeler
Copy link

is native aot for risc-v also covered here?

AOT on risc-v would open a huge possibilities even on small microcontrollers having a decent amount of DRAM (I have some of them)

@tomeksowi
Copy link
Contributor

@BruceForstall @jkotas Could you add @SzpejnaDawid to @dotnet/samsung (and @dotnet if necessary)? He joined our team in April and will be contributing to .NET RISC-V. Thank you.

@am11
Copy link
Member

am11 commented Aug 7, 2024

IMG_5357

MuseBook risc-v! 🎉 (it’s RVA22 + V ext) will unpack, then try out dotnet and run runtime tests! 🤞

@archanox
Copy link

archanox commented Aug 7, 2024

MuseBook risc-v! 🎉 (it’s RVA22 + V ext) will unpack, then try out dotnet and run runtime tests! 🤞

I've got the DC ROMA2 version. Do you have instructions on how to get dotnet running in its prerelease form?

@am11
Copy link
Member

am11 commented Aug 7, 2024

@archanox, I will polish up https://github.com/am11/CrossRepoCITesting/blob/master/.github/workflows/linux-riscv64-runtime-build.yml to upload artifacts, then we will get the runtime package in its releases. Later I will switch it to build source build (runtime+aspnetcore+sdk+everything-else). For now, having runtime will be enough to run .NET assemblies.

@filipnavara
Copy link
Member

I uploaded somewhat recent .NET SDK build for Risc-V here: https://github.com/filipnavara/dotnet-riscv/releases/tag/v9.0.0-preview.7.24405.7 (should be .NET 9 Preview 7). It has the same baseline requirements as the build from @am11, which means that the official Debian images for StarFive VisionFive 2 don't work (too old glibc). I checked that it runs on Ubuntu 24.04 which has some prebuilt images for common boards/machines.

@ww898
Copy link
Contributor

ww898 commented Aug 21, 2024

@filipnavara I got error on Ubuntu 24.04 riscv64 on StarFive VisionFive 2:

$ dotnet restore
/usr/local/dotnet/sdk/9.0.100-preview.7.24407.1/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(187,5): warning NETSDK1215: Targeting .NET Standard prior to 2.0 is no longer recommended. See https://aka.ms/dotnet/dotnet-standard-guidance for more details.
    /usr/local/dotnet/sdk/9.0.100-preview.7.24407.1/NuGet.targets(180,5): error : Root element is missing.

Restore failed with 1 error(s) and 1 warning(s) in 22.2s

Update §1: Started working after remove ~/.dotnet and ~/.nuget directories...

Update §2: All tests in my OSS projects are 🟢 green for now!!! Thanks a lot!!!

@pvelesko
Copy link

pvelesko commented Sep 5, 2024

@filipnavara

https://github.com/pvelesko/dotnet_riscv/releases/tag/v8.0.101

built dotnet with statically linked libstc++ the binary above works on the starfive visionfive 2 Debian image (old glibc)

@tkstanczak
Copy link
Contributor

would really need RISC-V support for https://github.com/NethermindEth/nethermind 🙏

@archanox
Copy link

I understand that the work on this is not undertaken by Microsoft, but rather Samsung hence having no official releases. But I'm wondering what the current state is for having a dotnet 9 release, if there's a release timeline, any blockers, outstanding work? I have a pioneer that's waiting in the midst that's waiting to run some of my workloads.

@sirntar
Copy link
Member

sirntar commented Dec 18, 2024

@archanox

I understand that the work on this is not undertaken by Microsoft, but rather Samsung hence having no official releases.

Yes, that's correct. You can truck current state of the project here: #84834

But I'm wondering what the current state is for having a dotnet 9 release, if there's a release timeline, any blockers, outstanding work? I have a pioneer that's waiting in the midst that's waiting to run some of my workloads.

At this moment tests pass rate for coreCLR is 99.8% and for coreFX about 97%, although there is still a lot of work to be done. Technically we have a working runtime, but the sdk is not yet fully built (there are some problems with msbuild - I'm working on it).
As for release of risc-v port for dotnet 9, there is currently no timeline, but I can tell you that it probably won't happen in the first quarter of 2025.

@hnedelciuc
Copy link

Is there any progress on RISC-V support? Any updates would be appreciated. Thanks.

@am11
Copy link
Member

am11 commented May 8, 2025

.NET 10 SDK daily builds are now flowing: https://github.com/filipnavara/dotnet-riscv/actions/runs/14891223063. NativeAOT is working in this build. We will switch to preview cadence with the next preview (p5); for now, it's an on-demand workflow and artifacts are from main branch of VMR repo: https://github.com/dotnet/dotnet.

@raffaeler
Copy link

@am11 A couple of questions please ...

  • Out of my curiosity, is RISC-V support planned to be 'official' in the upcoming .NET 10 releases or what else?
  • Could you please tell what are the rough minimum hardware requirements in terms of RAM and CPU flavors?

Thanks!

@filipnavara
Copy link
Member

  • Out of my curiosity, is RISC-V support planned to be 'official' in the upcoming .NET 10 releases or what else?

Official usually refers to Microsoft supported builds. That's very unlikely to happen, it is considered a community supported platform with the bulk of the work sponsored by Samsung.

  • Could you please tell what are the rough minimum hardware requirements in terms of RAM and CPU flavors?

As far as CPU flavors go, the baseline is RV64GC at the moment. There's no hard minimum requirement on RAM but the GC is likely to have some minimum allocation for the heap. It's known to work in 1Gb containers on Linux, so the limit is below that.

@raffaeler
Copy link

Thank you @filipnavara !
I see that boards based on that ISA level are still quite expensive (Alibaba TH1520 for example).

@martenf
Copy link
Contributor

martenf commented May 8, 2025

As far as CPU flavors go, the baseline is RV64GC at the moment.

Are there any plans to raise that requirement to RV64GCV in the near future?

@am11
Copy link
Member

am11 commented May 8, 2025

Are there any plans to raise that requirement to RV64GCV in the near future?

I think it won't happen in a short term. Vectorization is not implemented yet in JIT. Once it is implemented, and e.g. the Ubuntu LTS baselines to RVA23, then it would make sense to raise the requirement. Since the current Ubuntu 24.04 LTS' lowest profile support is RVA20, we can align with that. riscv64gc is only a subset of RVA20 https://github.com/riscv/riscv-profiles/blob/5879c13/src/profiles.adoc#512-rva20u64-mandatory-extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-riscv Related to the RISC-V architecture area-VM-meta-mono help wanted [up-for-grabs] Good issue for external contributors
Projects
No open projects
Development

No branches or pull requests