slp / krun

krun - run programs from your system in a microVM
MIT License
25 stars 7 forks source link

Set $MESA_LOADER_DRIVER_OVERRIDE to "asahi" to make Windows visible. #4

Closed SO5005 closed 1 month ago

slp commented 1 month ago

Thanks for the PR! The plan was, on krun (the one that runs on the host), detect that we're running on Asahi and then export MESA_LOADER_DRIVER_OVERRIDE. @teohhanhui WDYT?

teohhanhui commented 1 month ago

I had a commit where we were calling LANG=C eglinfo and just looking for EGL driver name: asahi. Is that okay?

https://github.com/slp/krun.legacy/pull/4#discussion_r1590459236

It'd be very complex to try to call EGL APIs directly. But sure, we could do it if you don't mind more code... (Will just port it from here: https://github.com/mpv-player/mpv/blob/d347ee0e916de83e74fc4dca1d35300307ce3f6b/video/out/opengl/egl_helpers.c#L313)

slp commented 1 month ago

I had a commit where we were calling LANG=C eglinfo and just looking for EGL driver name: asahi. Is that okay?

slp/krun.legacy#4 (comment)

It'd be very complex to try to call EGL APIs directly. But sure, we could do it if you don't mind more code... (Will just port it from here: https://github.com/mpv-player/mpv/blob/d347ee0e916de83e74fc4dca1d35300307ce3f6b/video/out/opengl/egl_helpers.c#L313)

I think it's better to just check /proc/device-tree/model or /proc/device-tree/compatible. We can take advantage that GPUs are embedded in this computers so we can safely assume that the asahi mesa driver must be used on them.

@SO5005 do you want to give this approach a try on this PR?