Skip to content

Update disk image source to addhypercall and gem5bridge-driver #69

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
wants to merge 27 commits into
base: develop
Choose a base branch
from

Conversation

Harshil2107
Copy link
Contributor

No description provided.

Harshil2107 and others added 22 commits September 13, 2024 10:41
- This change merges the packer files and adds an command line argument
which can be used to specify a version of ubuntu to build.

- Update build.sh to use the merged packer file

- Merge the arm and x86 disk image directories into a single directory
- This PR renames the `npb` directory to `npb-24.04-imgs`
- Adds packer files to make the x86 and arm npb images
- Adds other necessary files like `post-install.sh` that are required by
the image to build the NPB benchmarks

---------

Co-authored-by: Erin (Jianghua) Le <[email protected]>
This moves and creates the following directories
  - [x] add riscv-fs-alt folder
    - [x] rename riscv-fs to riscv-busy box
    - [x] delete opensbi-alt
    - [x] riscv boot no disk
    - [x] rename riscv-ubuntu to sicv ubuntu 20.04
    - [x] readme telling what each directory is
  - [x] add riscv-fs folder
    - [x]  riscv-ubutuntu 22.04 to riscv-ubuntu
    - [x] open-sbi
    - [x] readme telling what each directory is
- [x] add a examples folder, and move the following directories
  - [x] asm tests
  - [x] matrix multiply
  - [x] getting started
  - [x] print this
  - [x] insttests
  - [x] matrix-multiply-omp
- [x] add deprecated folder
  - [x] hack back
  - [x] parsec
  - [x] simple
- Deleteing the old npb contents as they have been moved to the source
of creating the new diskimages (`src/npb-24.04-imgs`
- Ubuntu updated the link on their website with the release of 24.04.01.
So I am updating the iso links to point to old releases. The checksum of
these new links are the same as the old ones
- workbegin now is called after timer_start
- workend is called before timer_end
The only change appears to be the following:
Rebasing Develop Branch on top of stable (gem5#47)

---------

Co-authored-by: Bobby R. Bruce <[email protected]>
This PR updates the compiler flags in make.def to make is.D.x for the
x86 image
- This commit updates the serial-getty service file to override only the service section with autologin instead of the entire file.
- This change should speed up boot time that is caused in gem5 due to low system entropy
- Update comments explaining the reason for increasing entropy
@Harshil2107 Harshil2107 requested a review from erin-le February 5, 2025 22:32
@Harshil2107
Copy link
Contributor Author

I have updated source for the NPB disk image to use hypercalls. I tested the NPB disk images on the staging branch for release 24.1.1. I was able to successfully run NPB benchmarks without using sudo in gem5 KVM simulation. All the hypercalls were triggered as expected.

@Harshil2107
Copy link
Contributor Author

TODO: I need to changes the link and the sha256sum for NPB disk image once the base disk image is uploaded to resources.

make -j 32 && \
make INSTALL_MOD_PATH=/workspace/output modules_install

RUN git clone https://github.com/gem5/gem5.git --depth=1 --filter=blob:none --no-checkout --sparse --single-branch --branch=release-staging-v24-1-1-0 && \
Copy link
Contributor

@erin-le erin-le Feb 7, 2025

Choose a reason for hiding this comment

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

Once the minor release staging branch is merged gem5 v25.0 is released, remember to change this to stable.

make -j $(nproc) && \
make INSTALL_MOD_PATH=/workspace/output modules_install

RUN git clone https://github.com/gem5/gem5.git --depth=1 --filter=blob:none --no-checkout --sparse --single-branch --branch=release-staging-v24-1-1-0 && \
Copy link
Contributor

@erin-le erin-le Feb 7, 2025

Choose a reason for hiding this comment

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

Once the minor release staging branch is merged gem5 v25.0 is released, remember to change this to stable.

--file "$DOCKERFILE" \
--output "$OUTPUT" .

echo "Build completed for $1: Output directory is $OUTPUT"
Copy link
Contributor

Choose a reason for hiding this comment

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

Right now, this message is printed even if the build fails. It would be nice if a different message could be printed for a failure, but it's not high priority.

--file "$DOCKERFILE" \
--output "$OUTPUT" .

echo "Build completed for $1: Output directory is $OUTPUT"
Copy link
Contributor

Choose a reason for hiding this comment

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

Right now, this message is printed even if the build fails. It would be nice if a different message could be printed for a failure, but it's not high priority.

Copy link
Contributor

@erin-le erin-le May 19, 2025

Choose a reason for hiding this comment

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

Suggested change
echo "Build completed for $1: Output directory is $OUTPUT"
if [ $? -eq 0];
then
echo "Build completed for $1: Output directory is $OUTPUT"
else
echo "Build failed for $1"
fi

This message could be modified to print different messages based on build failure/success. I haven't tested this code snippet, so please test it if you want to incorporate it into the script

}
```
```

If you need to increase the size of the image when adding more libraries and files to the image update the size of the partition in the respective `http/*/user-data` file. Also, update the `disk_size` parameter in `post-installation.sh` to be at least one mega byte more than the size you defined in the `user-data` file.

**NOTE:** You can extend this disk image by modifying the `post-installation.sh` script, but it requires building the image from scratch.

To take a pre-built image and add new files or packages, take a look at the following [documentation](https://www.gem5.org/documentation/gem5-stdlib/extending-disk-images).
Copy link
Contributor

Choose a reason for hiding this comment

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

This link appears to be broken

@Harshil2107 Harshil2107 force-pushed the add-hyper-call-to-disk branch from 6559de6 to b6830ca Compare February 18, 2025 17:50
@Harshil2107 Harshil2107 force-pushed the add-hyper-call-to-disk branch from b6830ca to 819ed59 Compare February 18, 2025 22:32
@Harshil2107 Harshil2107 changed the base branch from stable to develop February 18, 2025 23:59
@Harshil2107 Harshil2107 changed the base branch from develop to stable February 25, 2025 18:27
@Harshil2107 Harshil2107 changed the base branch from stable to develop May 16, 2025 22:46
memory = "8192"
output_directory = "disk-image-arm-npb"
output_directory = "disk-image-arm-npb-test"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this rename meant to be in the final version?

--file "$DOCKERFILE" \
--output "$OUTPUT" .

echo "Build completed for $1: Output directory is $OUTPUT"
Copy link
Contributor

@erin-le erin-le May 19, 2025

Choose a reason for hiding this comment

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

Suggested change
echo "Build completed for $1: Output directory is $OUTPUT"
if [ $? -eq 0];
then
echo "Build completed for $1: Output directory is $OUTPUT"
else
echo "Build failed for $1"
fi

This message could be modified to print different messages based on build failure/success. I haven't tested this code snippet, so please test it if you want to incorporate it into the script

--file "$DOCKERFILE" \
--output "$OUTPUT" .

echo "Build completed for $1: Output directory is $OUTPUT"
Copy link
Contributor

@erin-le erin-le May 19, 2025

Choose a reason for hiding this comment

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

Suggested change
echo "Build completed for $1: Output directory is $OUTPUT"
if [ $? -eq 0];
then
echo "Build completed for $1: Output directory is $OUTPUT"
else
echo "Build failed for $1"
fi

This message could be modified to print different messages based on build failure/success. I haven't tested this code snippet, so please test it if you want to incorporate it into the script

Comment on lines 13 to 15
# Installing the packages in this script instead of the user-data
# file dueing ubuntu autoinstall. The reason is that sometimes
# the package install failes. This method is more reliable.
Copy link
Contributor

Choose a reason for hiding this comment

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

Typos in this comment

fi

# Just get the files we need
git clone https://github.com/gem5/gem5.git --depth=1 --filter=blob:none --no-checkout --sparse --single-branch --branch=release-staging-v24-1-1-0
Copy link
Contributor

Choose a reason for hiding this comment

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

Once gem5 v25.0 is released, remember to change this to stable

## Disk Image
After building the Dockerfile, you can retrieve the kernel and modules on your host using the `copy_modules_to_host.sh` script.
- **`scripts/`**: Contains scripts that run on the disk image after installation.
- **`disable-network.sh`**: Disables networking by renaming the Netplan configuration file (`.yaml` → `.yaml.bak`) and disabling network services in systemd. Disabling network decreases boot time by removing the 2 minute wait for network service to get online in systemd.
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be good to clarify that the 2 minute wait is in simulation time, not wall-clock time.

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.

2 participants