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

Linux support #121

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open

Linux support #121

wants to merge 24 commits into from

Conversation

joaompneves
Copy link
Collaborator

@joaompneves joaompneves commented Nov 23, 2023

Follow-up of #119

This PR adds support for Linux x64 platform. If asked, the Linux ARM64 platform can be added as well.

Includes edits from PR #88 alongside with my own edits #88 (comment).

Requires more testing.

Tested on these platforms and hardware configurations:

✔️ Arch Linux with Intel GPU: Works well.
✔️ Arch Linux with NVIDIA GPU (Proprietary Drivers): Works well.
✔️ Arch Linux with NVIDIA GPU (Lately Open-Sourced Drivers): Works well.
❌ Debian 12 on QEMU virtual machine (GPU options: Virtio, VGA, QXL): No window shows up. Error message says libva device = null on some devices. Disabling GPU with "--disable-gpu" did nothing.
Needs testing on:

AMD GPU
Other distributions

@joaompneves joaompneves mentioned this pull request Nov 23, 2023
@Haltroy

This comment was marked as outdated.

@JerryJian
Copy link

@joaompneves any progress on this?

@joaompneves
Copy link
Collaborator Author

Nope. I opened this PR to unblock some pipeline issues we were having, but I did not authored the changes.
Unless anyone interested pursues this, I won't be following-up. I can help but won't lead.

@Haltroy
Copy link

Haltroy commented Feb 18, 2024

Started working on this again, it finally copies the subprocess but now I can't load libcef.so from subprocess's path. It's an issue on Xilium.CefGlue.CefRuntime.CheckVersionByApiHash function which crashes on libcef.api_hash(0) line.
Copying the entire CEF into the application folder fixes it but that wouldn't be ideal since this way you would end with 2 CEF's (both combined is 400MB) in both the application's folder and in CefGlueBrowserProcess folder. For now this is at the highest priority on my TODO list.

Also, tested on virtual machine (Fedora 39) and my system (Arch) to discover that it still won't render on normal mode but renders on WindowlessRender mode. Also it randomly crashes. I'm investigating both of these 2 issues to see what's causing them but they are now in lower priority.

I'll create a PR again once I'm sure that it is done but now everyone can access my fork from here. I also had to publish CEF binaries under another name (yes the only missing thing in my way was me not stripping binaries). It's available here.

@Haltroy
Copy link

Haltroy commented Feb 21, 2024

I discovered that it still won't render on normal mode because we simply don't have a wrapper for libX11 and thus CEF gives X errors while attempting to bind to Avalonia control. I simply lack on making wrappers for C#.

In the future when Avalonia finally supports Wayland, we also need a wrapper for that but for now since Avalonia is X11 only we don't have to make that.

@baimindong
Copy link

Unhandled exception. System.IO.FileNotFoundException: Unable to find SubProcess. Probed locations: /linux-x64/CefGlueBrowserProcess/Xilium.CefGlue.BrowserProcess

2 similar comments
@baimindong
Copy link

Unhandled exception. System.IO.FileNotFoundException: Unable to find SubProcess. Probed locations: /linux-x64/CefGlueBrowserProcess/Xilium.CefGlue.BrowserProcess

@baimindong
Copy link

Unhandled exception. System.IO.FileNotFoundException: Unable to find SubProcess. Probed locations: /linux-x64/CefGlueBrowserProcess/Xilium.CefGlue.BrowserProcess

@Haltroy
Copy link

Haltroy commented Apr 2, 2024

Unhandled exception. System.IO.FileNotFoundException: Unable to find SubProcess. Probed locations: /linux-x64/CefGlueBrowserProcess/Xilium.CefGlue.BrowserProcess

Fixed it in an upcoming PR (currently located in here), still lacking code to reparent CEF window to Avalonia native control host properly.

@walterlv
Copy link
Contributor

@Haltroy I just ran your offscreen rendering and it worked correctly. And now I'll try to implement the Avalonia native control host on X11 based on your branch and this .NET 8 main branch. I hope we can keep in touch to share our knowledge and process.

@Haltroy
Copy link

Haltroy commented Jun 28, 2024

@Haltroy I just ran your offscreen rendering and it worked correctly. And now I'll try to implement the Avalonia native control host on X11 based on your branch and this .NET 8 main branch. I hope we can keep in touch to share our knowledge and process.

My current branch is using the old Avalonia 10.x code and I haven't updated it properly yet. Will do that right after my finals are done. But I'm glad that someone can help with this issue that's haunting me for months.

EDIT: I updated it, but for some reason some issues that I fixed before came back. I'll try to fix it but to simply cut short copy the subprocess DLL to the demo app's executable folder. Also still can't debug it on Rider and .NET CLI can't properly build it directly.

@walterlv
Copy link
Contributor

walterlv commented Jul 1, 2024

My current branch is using the old Avalonia 10.x code and I haven't updated it properly yet. Will do that right after my finals are done. But I'm glad that someone can help with this issue that's haunting me for months.

I've updated it, don't worry.

#146

@Haltroy
Copy link

Haltroy commented Jul 1, 2024

My current branch is using the old Avalonia 10.x code and I haven't updated it properly yet. Will do that right after my finals are done. But I'm glad that someone can help with this issue that's haunting me for months.

I've updated it, don't worry.

#146

Updated mine as well, please see the edit I made above.

@walterlv
Copy link
Contributor

@Haltroy

@kkwpsv has a new great job on this. See here: Haltroy#3

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

Successfully merging this pull request may close these issues.

None yet

5 participants