openhwgroup / cvw

CORE-V Wally is a configurable RISC-V Processor associated with RISC-V System-on-Chip Design textbook. Contains a 5-stage pipeline, support for A, B, C, D, F, M and Q extensions, and optional caches, BP, FPU, VM/MMU, AHB, RAMs, and peripherals.
Other
256 stars 182 forks source link

wally-toolchain-install.sh error #1003

Open amar6905 opened 4 days ago

amar6905 commented 4 days ago

Hello everyone,

The error I get when running wally-toolchain-install.sh is this: image

Has anyone came across this problem before?

davidharrishmc commented 4 days ago

What operating system and version are you using?

On Sat, Oct 12, 2024 at 5:12 PM amar6905 @.***> wrote:

Hello everyone,

The error I get when running wally-toolchain-install.sh is this: image.png (view on web) https://github.com/user-attachments/assets/f3186df6-972a-4fc6-a4e9-b5ab99526b1e

Has anyone came across this problem before?

— Reply to this email directly, view it on GitHub https://github.com/openhwgroup/cvw/issues/1003, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR4AA3ZKM6V75LAMEB33VULZ3G3CTAVCNFSM6AAAAABP23TOM6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGU4DGNJSGQ4DEOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

amar6905 commented 4 days ago

Hi, I am using WSL 2 and this is my Ubuntu version: image

jordancarlin commented 4 days ago

We haven't done any testing using WSL. Can you attach the log file at /opt/riscv/logs/riscv-gnu-toolchain.log? Also, what does the system you are running it on look like (memory, cores, etc.)? The error message g++: fatal error: Killed signal terminated program cc1plus is often a sign of a lack of system resources.

Also, issue #1002 will likely prevent a fresh install from working at the moment. Hoping to get that resolved soon.

amar6905 commented 4 days ago

Hi,

The processor of my machine is the AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx 2.10 GHz which is 4 cores and 8 threads. Memory is 8 GB and SSD is 512 GB. I have also attached the log here riscv-gnu-toolchain.log

jordancarlin commented 4 days ago

Can you try setting NUM_THREADS to 1 near the top of wally-tool-chain-install.sh? This will give a cleaner log file and reduce memory pressure. If that still doesn't work and there is no obvious clue in the log file, then I would recommend opening an issue with https://github.com/riscv-collab/riscv-gnu-toolchain since that is the tool that is failing to install.

amar6905 commented 4 days ago

Okay I will try the following, thank you

amar6905 commented 4 days ago

If I am able to build Newlib cross-compiler directly from https://github.com/riscv-collab/riscv-gnu-toolchain. Would that be sufficient for building core-v-wally or are there other crucial tool dependencies?

stineje commented 3 days ago

+amar6905

Hi! The key to the repository (and the book) is that everything is included for development and testing. It includes the gcc compiler you indicated + other items such as Spike, SAIL, QEMU and other tools. Let us know if you get any errors and we are happy to help.

The machine specifications you listed should be sufficient. We have good success with Ubuntu LTS versions. Take care.

All my best,

James

On Oct 13, 2024, at 1:59 AM, amar6905 @.***> wrote:

If I am able to build Newlib cross-compiler directly from https://github.com/riscv-collab/riscv-gnu-toolchain https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Friscv-collab%2Friscv-gnu-toolchain&data=05%7C02%7Cjames.stine%40okstate.edu%7C955f2e476b974005f51a08dceb548af9%7C2a69c91de8494e34a230cdf8b27e1964%7C0%7C0%7C638643995561446143%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=D7IvoYpgun0TQwODU9sUVibTg9d2anTZRvy%2BL6BIkCo%3D&reserved=0. Would that be sufficient for building core-v-wally or are there other crucial tool dependencies?

— Reply to this email directly, view it on GitHub https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fopenhwgroup%2Fcvw%2Fissues%2F1003%23issuecomment-2408852614&data=05%7C02%7Cjames.stine%40okstate.edu%7C955f2e476b974005f51a08dceb548af9%7C2a69c91de8494e34a230cdf8b27e1964%7C0%7C0%7C638643995561467751%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=bSRjEWxubyAdGctq6qZ%2BpXlTMVcLJx9QbMuTm6RkILo%3D&reserved=0, or unsubscribe https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAFSIHPEDRWPDFLPPCZ3ISU3Z3IK35AVCNFSM6AAAAABP23TOM6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBYHA2TENRRGQ&data=05%7C02%7Cjames.stine%40okstate.edu%7C955f2e476b974005f51a08dceb548af9%7C2a69c91de8494e34a230cdf8b27e1964%7C0%7C0%7C638643995561483814%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=7oRoYryQDbIri3dBrZZaaVVCRMyFJok27yko8bfd0AU%3D&reserved=0. You are receiving this because you are subscribed to this thread.

amar6905 commented 3 days ago

@stineje Hi stineje, Thank you for your assistance. So wally-tool-chain-install.sh is failing for me at line 216, which seems to be making the multilib installation (Linux+Newlib) line 216: make -j "${NUM_THREADS}" 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ]

As a test, I separately cloned the riscv-gnu-toolchain from here: https://github.com/riscv-collab/riscv-gnu-toolchain and I ran "make" for newlib installation which turned out successful here: image

I also ran "make linux" for linux compiler installation and it was successful too.

So my question would be, what is the best way to bypass line 216 in wally-tool-chain-install.sh? So I could be able to run all the other subsequent tool installations

I am quite new to shell scripting but does line 216 have any parameter differences compared to the way I manually installed the riscv-gnu-toolchain by "make" and "make linux"?

davidharrishmc commented 3 days ago

Try deleting the -j “${NUM_THREADS}” and then do “make clean” and then “make”. Jordan had suggested something along these lines

That will cause Make to run sequentially rather than in parallel. Your system has only 8 GB of RAM, so perhaps the parallel installation is overtaxing it.

David Harris

On Oct 13, 2024, at 3:22 PM, amar6905 @.***> wrote:

@stineje https://github.com/stineje Hi stineje, Thank you for your assistance. So wally-tool-chain-install.sh is failing for me at line 216, which seems to be making the multilib installation (Linux+Newlib) make -j "${NUM_THREADS}" 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ]

As a test, I separately cloned the riscv-gnu-toolchain from here: https://github.com/riscv-collab/riscv-gnu-toolchain and I ran "make" for newlib installation which turned out successful here: image.png (view on web) https://github.com/user-attachments/assets/ac7e1e1c-0988-49de-9782-cdc11da2fdd6 I also ran "make linux" for linux compiler installation and it was successful too.

So my question would be, what is the best way to bypass line 216 in wally-tool-chain-install.sh? So I could be able to run all the other subsequent tool installations

I am quite new to shell scripting but does line 216 have any parameter differences compared to the way I manually installed the riscv-gnu-toolchain by "make" and "make linux"?

— Reply to this email directly, view it on GitHub https://github.com/openhwgroup/cvw/issues/1003#issuecomment-2409199976, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR4AA3675K32BILQRSDD7ZDZ3LXA5AVCNFSM6AAAAABP23TOM6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBZGE4TSOJXGY. You are receiving this because you commented.

jordancarlin commented 3 days ago

PR #1005 automatically limits the number of threads used for installation on systems with limited memory. Try running the installation script from scratch and see if that works.

amar6905 commented 1 day ago

@davidharrishmc Hi your suggestion helped me a lot, thank you. I was able to successfully build all the toolchains in the script except for "buildroot and linux testvectors" part. The error I am getting is: image

line 397: make -j 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ]

when I echo $dir it is set to the main /cvw/ directory.

when I manually enter line 395: cd "$dir"/../linux - the directory does not exist

is line 395 supposed to be cd "$dir"/../linux or cd "$dir"/linux?

Thanks

jordancarlin commented 1 day ago

What was printed right above the error message/what is in the mentioned log file?

Also, were you running the commands manually or running the script itself? The command in the script that is setting $dir sets it to the directory that the current command is running from. If you run the wally-tool-chain-install.sh script then this will be the bin directory, so $dir/../linux is correct. If you copied the commands into the terminal directly while in the cvw directory, then $dir will be set to cvw, which could be the cause of your error.