-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
muvm: init from krun as 0.2.0 #347792
base: master
Are you sure you want to change the base?
muvm: init from krun as 0.2.0 #347792
Conversation
Should this be a draft then? |
Yes, woops |
Diff looks fine to me, once it actually works :) |
Yeah, it's not like there's anything bad on our side. It's just upstream has issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mainProgram should be muvm as well?
Are you sure the segfault is actually muvm's fault? I ran into the same issue at first but then realised it was just because muvm was using regular nixpkgs mesa, not Asahi mesa, since After that I ran into muvm hardcoding the path to diff --git a/crates/muvm/src/guest/bin/muvm-guest.rs b/crates/muvm/src/guest/bin/muvm-guest.rs
index 311b2ca..b726547 100644
--- a/crates/muvm/src/guest/bin/muvm-guest.rs
+++ b/crates/muvm/src/guest/bin/muvm-guest.rs
@@ -38,7 +38,7 @@ fn main() -> Result<()> {
if let Err(err) = mount_filesystems() {
return Err(err).context("Failed to mount filesystems, bailing out");
}
- Command::new("/usr/lib/systemd/systemd-udevd").spawn()?;
+ Command::new("@systemd-udevd@").spawn()?;
setup_fex()?;
|
It feels like it based on the debug log output and that my shell says this:
But I'm not using
Alright, I'll add that patch. |
6cfc01a
to
4db4337
Compare
I got the exact same error too: a proper version mismatch error would have made more sense, but I can attest that running muvm via.
I'm assuming you're using nixos-apple-silicon: to avoid rebuilding the world, by default when you enable GPU support, it uses (I guess |
Was able to get it to run, the problem is indeed the mesa stuff. |
It builds fine for me but I get this error when running it (on Asahi Linux):
|
4db4337
to
6340406
Compare
I've rebased it to fix conflicts and got it as 0.2.0 now. Once approved, I'll merge this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And maybe meta.mainProgram
needs an update?
pkgs/by-name/li/libkrun/package.nix
Outdated
@@ -61,10 +63,13 @@ stdenv.mkDerivation (finalAttrs: { | |||
++ lib.optional withSound pipewire | |||
++ lib.optional sevVariant openssl; | |||
|
|||
env.LIBCLANG_PATH = "${llvmPackages.clang-unwrapped.lib}/lib/libclang.so"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use rustPlatform.bindgenHook
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
src = fetchFromGitHub { | ||
owner = "slp"; | ||
owner = "AsahiLinux"; | ||
repo = pname; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repo = pname; | |
repo = "muvm"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change really necessary? pname
is already muvm
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Purely cosmetic now, but can be problematic in combination with finalAttrs in the future: #310373
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok but we're using buildRustPackage
which doesn't support finalAttrs
, is there plans to make buildRustPackage
support finalAttrs
or has that already happened?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It SHOULD happen I guess? Not aware of the progress though.
Just a segfault, no other messages. |
I think you should be able to use |
Ended up being the usual mesa issue so I think it's good on my side once I load it in with the right mesa. |
2254e59
to
b602132
Compare
Rebased + ping to hopefully get a review, this PR should've been merged months ago. |
One question: this doesn't work on x86_64-linux right? Seems to have some aarch64 specific codes. |
I'm not sure, maybe give it a try? |
|
I can run bash, but X11 pass-through won't work. |
A few other hard coded paths to be patched:
And ideally, bind mount |
Done
The patch has conflicts and it seems upstream wants to go a different direction so it might be better to wait for that. |
pkgs/by-name/mu/muvm/package.nix
Outdated
license = lib.licenses.mit; | ||
maintainers = with lib.maintainers; [ RossComputerGuy ]; | ||
platforms = libkrun.meta.platforms; | ||
mainProgram = "krun"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mainProgram = "krun"; | |
mainProgram = "muvm"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
9fb4b66
to
619e3ed
Compare
I was trying to run muvm on my machine (M1) with Asahi and NixOS using this module, but I kept getting same thread panic error as @diegobfernandez and @Liamolucko. I tried updating muvm, libkrun, and libkrunfw, along with applying muvm PR #38, but to no avail. Has anyone else found a way of running muvm on Asahi on NixOS? @RossComputerGuy, it seems you have spent some time thinking about this and help would be appreciated. Being able to use wine to run windows executables would be quite nice. Currently, the method proposed by @bhenson in NixOS Discourse, while a bit unorthodox, has been the most functional that I have come across. |
Did you try using Asahi's fork of virglrenderer like I suggested?
I've been able to get GUI programs working, as well as x86 emulation; I haven't tried Wine, though. GPU acceleration for x86 programs doesn't work, since although a rootfs isn't needed for most Nix stuff thanks to everything using absolute paths to the x86 versions of their dependencies anyway, that isn't the case for GPU drivers: programs that need them will link against whatever's in |
619e3ed
to
06d11ff
Compare
@Liamolucko, thanks for your response.
I just tried this, and it did have an effect! Unfortunately, it was just causing the same error to occur much faster than without it.
I haven't been able to so far, and it even seems that, in whatever cursed setup I have created, muvm doesn't even get as far as processing its arguments. Both From my understanding, it seems that muvm is trying to access paths which don't exist on NixOS. From our end, wouldn't it be easier just to make some symlinks ourselves to accommodate for where muvm expects to find drivers? |
Did you miss patching the path of I've pushed the exact version I'm using at https://github.com/Liamolucko/nix-config (which doesn't require setting
No, not really (well, that is the case with The problem is that the path in |
Actually, I suppose a different solution would be to restore Personally I still think the rootfs solution is probably cleaner, though. Perhaps it could be integrated into the |
Things done
Somewhat recently, krun was moved from slp to Asahi Linux and renamed. I've gone ahead and rename it. Unfortunately, there's an upstream issue where muvm doesn't run at all. AsahiLinux/muvm#81
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.