Skip to content

Conversation

@katebern-grovety
Copy link

Currently the ci_riscv docker image uses GNU toolchain for Xuantie RISC-V CPU, which does not contain V-extension instructions. This PR adds GNU toolchain for RISC-V from RISC-V Collaboration. This update is required for the PR

Currently the ci_riscv docker image uses GNU toolchain for Xuantie RISC-V CPU, which does not contain V-extension instructions. This PR adds GNU toolchain for RISC-V from RISC-V Collaboration.
@tvm-bot
Copy link
Collaborator

tvm-bot commented Jul 25, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@katebern-grovety
Copy link
Author

TMPDIR=$(mktemp -d)
RISCV_GCC_EXT="tar.gz"
RLS_TAG="2023.07.07"
RISCV_GCC_URL="https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/${RLS_TAG}/riscv64-glibc-ubuntu-22.04-gcc-nightly-${RLS_TAG}-nightly.${RISCV_GCC_EXT}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In contrast to the Xuantie GCC, this is a non-multilib build of the RISC-V GNU Toolchain. Support is probably limited to rv64gc/lp64d.

In the long term, we should find a way to support riscv32 and riscv64 (eventually, with different levels of floating-point support).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @PhilippvK! I'll replace it with a multilib build.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have an guess on how long the from source build will take? I am not sure If this would be acceptable… Maybe there is a multilib build available to use here: https://github.com/sifive/freedom-tools/releases

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it will take a few hours, by the link you specified there are builds from two years ago. As a solution, I can publish a release in forked riscv-gnu-toolchain repository.

../configure --prefix=`pwd`/install --host=riscv64-unknown-linux-gnu
make -j`nproc`
make install
cp ./pk $INSTALLATION_PATH/bin/pk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue here. RISC-V proxy kernel needs to be built separately for rv32gc and rv64gc.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add build for rv32gc and rv64gc.

@PhilippvK
Copy link
Contributor

The RISC-V GCC is only supposed to be used for linking and providing the libc headers to Clang right?

@katebern-grovety
Copy link
Author

The RISC-V GCC is only supposed to be used for linking and providing the libc headers to Clang right?

Yes, RISC-V GCC is used for linking and providing libs.

Build from source multilib RISC-V GNU toolchain
Add builds rv32gc and rv64gc for RISC-V Proxy Kernel
Fix Spike version
@alter-xp
Copy link
Contributor

alter-xp commented Aug 4, 2023

The current version of Xuantie GCC supports V-extension. However, as I mentioned in the PR, is it syntactically correct to directly use vwredsum ?

@katebern-grovety
Copy link
Author

The current version of Xuantie GCC supports V-extension. However, as I mentioned in the PR, is it syntactically correct to directly use vwredsum ?

But on the current version of the toolchain, the error
/opt/riscv/riscv64-unknown-linux-gnu/bin/riscv64-unknown-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0_v1p0_zve32f1p0_zve32x1p0_zve64d1p0_zve64f1p0_zve64x1p0_zvl128b1p0_zvl32b1p0_zvl64b1p0: Invalid or unknown z ISA extension: 'zve' occurs, and there are no errors with the updated toolchain.

Instead of vwredsum I'll use vwredsum_vs_i16m1_i32m1.

@tqchen tqchen closed this Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants