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

krunkit libkrun virglrenderer: new ports #27208

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tsujp
Copy link
Contributor

@tsujp tsujp commented Dec 26, 2024

Description

Three (3) new ports:

  1. krunkit
  2. libkrun
  3. slp's fork of virglrenderer with required patches for libkrun since these are not merged into virglrenderer upstream.

krunkit allows running VMs on macOS using Hypervisor.framework with hardware accelerated graphics using Venus.

Podman can also use krunkit as a driver instead of the default applehv (Virtualization.framework). If you configure Podman to use krunkit you can run hardware accelerated graphics workloads within the VM (and thus containers) Podman manages on your macOS hosts.

libkrun allows use of more modern versions of virtio and has some advanced networking features (although the latter is not enabled by default nor available at all as I cannot be bothered).

There are a few questions I have regarding this:

  1. I plan to add a libkrun variant to the Podman port, this would simply add krunkit as a runtime dependency. Strictly speaking uninstalling krunkit would not break Podman as Podman executes the binary krunkit when configured to use it. It does feel nicer to be able to install Podman with krunkit in one go though. Shall I add said variant?
  2. The version of virglrenderer here is slp's fork as already mentioned. Would you prefer I change the Portfile to use upstream virglrenderer and add a libkrun variant to virglrenderer which uses slp's or shall we leave the Portfile as-is only use slp's for now? In the former case how does one specify a variant in build_run?

Once those questions have answers I can do some final cleanup on the Portfiles (as I've left the TODOs in so I do not forget).

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 14.5 23F79 arm64
Xcode 16.0 16A242d

Verification

Have you

Copy link
Contributor

@reneeotten reneeotten left a comment

Choose a reason for hiding this comment

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

thanks for the submissions @tsujp. I've left a few comments, they apply to all ports.

Also, each ports should be in a different commit please.

emulators/krunkit/Portfile Outdated Show resolved Hide resolved
emulators/krunkit/Portfile Outdated Show resolved Hide resolved
@@ -0,0 +1,100 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

# Upstream build source (until more official): https://github.com/slp/homebrew-krunkit/blob/main/Formula/krunkit.rb
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove unneeded comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might be useful for now though as that's how the software should be built? Makes it easier to view those files as (if) things change?

emulators/krunkit/Portfile Outdated Show resolved Hide resolved
emulators/krunkit/Portfile Outdated Show resolved Hide resolved
emulators/libkrun/Portfile Outdated Show resolved Hide resolved
* Specifically this is slp's fork for use in libkrun.
* Specifically this is the EFI flavour for use in krunkit.
@tsujp tsujp requested a review from reneeotten December 26, 2024 17:41
@tsujp
Copy link
Contributor Author

tsujp commented Dec 26, 2024

thanks for the submissions @tsujp. I've left a few comments, they apply to all ports.

Also, each ports should be in a different commit please.

Changes made; requested re-review.

@tsujp
Copy link
Contributor Author

tsujp commented Dec 26, 2024

I note that sudo port -vst install krunkit does not work (the -t trace flag is the culprit), but sudo port -vs install krunkit works fine.

It fails around extracting virglrenderer (as of course it prompts to install dependencies). I'm very tired right now so I'm not sure why or if it's actually important?

sudo port -vs install krunkit installs krunkit, libkrun, and virglrenderer fine and Podman can correctly use krunkit and there appears to be the graphics drivers in the VM at /dev/dri which indicates all is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants