Benchmarking RISC-V QEMU User mode Emulator with SPEC CPU2017(Multicore/intrate)
By Ali Tariq | July 2, 2024

In the previous blog, I described how to execute the SPEC 2017 benchmark on a QEMU system-level emulator which has a whole Linux distro running on an emulated RISC-V compute instance. 

This blog describes the execution command and results for running the SPEC 2017 benchmark on QEMU user mode which, itself, runs on an architecture that is not RISC-V and is used for running a single binary compiled for RISC-V.

This benchmark is run on qemu-riscv64 version 8.2.1 running on ubuntu 22.04 LTS on x86.

The environment is an LXC container which is allocated 4 cores of AMD EPYC™ 7713, 8GB of memory, and 2GB of swap.

Source code modifications

Usually, the SPEC benchmark is run in such a way that the user executes a single bash script which in turn calls perl scripts and those perl scripts call other relevant scripts. 

The issue with this approach is that, for running a binary on a QEMU user-mode, the binary should be compiled for RISC-V architecture and should be present on architecture other than RISC-V (x86 in this case). For this to work, every binary that SPEC CPU 2017 creates during the execution of the test should be compiled for RISC-V architecture and should execute on QEMU instead of native architecture.

For this purpose, I had to tweak the harness of SPEC CPU 2017, so that the execution command prepends qemu-riscv64 -L <test_to_execute>.

*If you need information or help regarding how this can be done, contact cloud-v@10xengineers.ai*

Execution of tests

The execution command is not the same as that of previous tests. I had to run tests without the reportability flag and without peak settings of compiler. The test command is as follows.

./runcpu --config="/home/user1/gcc-linux-qemu-riscv64.cfg" <testname>

I used this command with all the intrate tests separately to obtain separate results.

Results

Individual Test Results

The individual test results of qemu-riscv64 are as follows:


A Chart Title


Final Results (comparison with physical hardware)

The following results of other instances are taken out from previous SPEC CPU intrate/multicore blog.



Conclusion

These results show us that qemu-riscv64 user mode emulator is even faster than qemu-system-riscv64 and with latest specification changes. This makes the RISC-V software development streamlined and even faster on emulated RISC-V compute instances.

Benchmarking RISC-V QEMU User mode Emulator with SPEC CPU2017(Multicore/intrate)
Cloud-V 2 July, 2024
Share this post
Tags
Archive

Benchmarking RISC-V QEMU Emulator with SPEC CPU2017(Single Core/fprate)
By Ali Tariq | May 16, 2024