Skip to content
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

krun: set the vRAM size for the microVM #69

Merged
merged 2 commits into from
Oct 1, 2024

Commits on Oct 1, 2024

  1. krun: set the vRAM size for the microVM

    Starting v1.9.5, libkrun allows configuring the size of the SHM window
    for virtio-gpu, which acts as a pseudo-vram (previously it was hardcoded
    to a conservative 8GB).
    
    Let's use that feature to configure the vRAM of the microVM to a
    reasonable value. Since we expect userspace drivers in the guest to be
    conservative for us, telling appliations that vRAM is just a percentage
    of the guest's RAM, let's just set vRAM to be the same as the total
    amount of RAM in the system, leaving some room for potential
    fragmentation.
    
    Also, introduce the "--vram" command flag to allow users to override the
    default value.
    
    While there, also remove the 32 GB limit, since libkrun does support
    guests larger than that.
    
    Signed-off-by: Sergio Lopez <[email protected]>
    slp committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    8ccaf6c View commit details
    Browse the repository at this point in the history
  2. Ensure we leave at least 3072MiB free to the host

    Leaving less than 3072MiB for the host can compromise the system's
    stability, so ensure we do that unless instructed by the user. This
    mainly applies to 8GB systems.
    
    Signed-off-by: Sergio Lopez <[email protected]>
    slp committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    3b9f344 View commit details
    Browse the repository at this point in the history