Skip to content

Comments

Passthru NixOS system & OpenGL Driver#38

Closed
RossComputerGuy wants to merge 1 commit intoAsahiLinux:mainfrom
RossComputerGuy:fix/nixos
Closed

Passthru NixOS system & OpenGL Driver#38
RossComputerGuy wants to merge 1 commit intoAsahiLinux:mainfrom
RossComputerGuy:fix/nixos

Conversation

@RossComputerGuy
Copy link

Fixes #37 by passing thru the NixOS system and OpenGL driver.

@RossComputerGuy RossComputerGuy force-pushed the fix/nixos branch 4 times, most recently from 9a791fe to 2183a0f Compare June 20, 2024 19:30
Signed-off-by: Tristan Ross <tristan.ross@midstall.com>
@RossComputerGuy
Copy link
Author

Gets as far as:

sommelier_scope_timer: init wayland channel: 0.000250 seconds
DRM_IOCTL_ASAHI_GET_PARAMS failed: Invalid argument
sommelier_scope_timer: drm device: 0.070801 seconds
sommelier_scope_timer: connect display: 0.000026 seconds
sommelier_scope_timer: client create: 0.000015 seconds
sommelier_scope_timer: display implementation: 0.000004 seconds
sommelier_scope_timer: spawn xwayland: 0.000156 seconds
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running

Then hangs, it's progress

@slp
Copy link
Collaborator

slp commented Jun 24, 2024

@teohhanhui PTAL.

@teohhanhui
Copy link
Collaborator

teohhanhui commented Jun 24, 2024

This seems like it's maybe the wrong approach?

https://nixos.wiki/wiki/OpenGL

Disclaimer: I have never used NixOS or even Nix. I'm just basing my judgement on the documentation I can find.

But if this is required, I think we could just automatically mount /run/opengl-driver and /run/current-system (if they exist) without having to pass those env vars (which don't make sense to me...) - WDYT @slp?

@RossComputerGuy
Copy link
Author

RossComputerGuy commented Jun 24, 2024

This seems like it's maybe the wrong approach?

Yeah this is the first time I coded in Rust and I'm not entirely sure how krun works so this was the approach I could come up with.

https://nixos.wiki/wiki/OpenGL

Disclaimer: I have never used NixOS or even Nix. I'm just basing my judgement on the documentation I can find.

New wiki: https://wiki.nixos.org/wiki/OpenGL

/run/opengl-driver is a symlink to a directory in /nix/store and so is /run/current-system. Probably the best way is to read the OpenGL driver path on host and then find if it's a symlink, resolve the symlink of it is, and then pass it through. I'm not sure how /run/current-system could be resolved but as it is in $PATH, could parse that and then resolve and pass through whatever is a symlink.

@hoshinolina
Copy link
Contributor

hoshinolina commented Oct 4, 2024

I'm torn over whether we should share /run as a whole or not. There are things like /run/media that make sense to share. On the other hand, that doesn't work even if you do mount it right now due to missing POSIX ACL support...

One thing we do have since a recent change is /run/muvm-host. That exposes the entire host FS without any overlaid mounts. A simple way of implementing this now would be to check if /run/muvm-host/run/{opengl-driver,current-system} exist and if they do, symlink them back into /run. This could be implemented with a list of things in /run to symlink so it can be easily extended in the future, such as also doing /run/media once that otherwise works.

Aside: I think it's worth implementing a feature to run a user-specified script as root on VM startup. There are going to be people with custom setups who want to do some mount management or other root-requiring tasks on VM startup.

@RossComputerGuy
Copy link
Author

One thing we do have since a recent change is /run/muvm-host. That exposes the entire host FS without any overlaid mounts. A simple way of implementing this now would be to check if /run/muvm-host/run/{opengl-driver,current-system} exist and if they do, symlink them back into /run.

Yeah, I think that might be a good way.

Aside: I think it's worth implementing a feature to run a user-specified script as root on VM startup. There are going to be people with custom setups who want to do some mount management or other root-requiring tasks on VM startup.

True, some sort of pre and post run scripts that could be specific or pulled from home might be good as well.

@nrabulinski
Copy link
Contributor

This PR is obsolete now

@RossComputerGuy RossComputerGuy deleted the fix/nixos branch April 13, 2025 20:39
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.

Issues with /run on NixOS

5 participants