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

Fix multi-GPU support for Nvidia #147

Merged
merged 8 commits into from
Mar 2, 2025
Merged

Conversation

PlasmaPower
Copy link
Contributor

This PR has two commits to fix running aquamarine against multiple Nvidia GPUs which provide different output monitors:

  • A small commit to not force linear allocation on devices which don't support it, even if multigpu is enabled. This is necessary as Nvidia doesn't support the linear format.
  • A Renderer commit to, if creating an EGL image from the source buffer fails, instead copy it to an intermediate buffer on the CPU memory first, then copy that intermediate buffer to the output buffer. This fixes Nvidia multigpu because Nvidia doesn't support attaching another gpu's buffer as an EGL image, so instead this PR first reads the source buffer into CPU memory using the primary renderer's EGL context, and then does the rest of the blit as normal on the secondary GPU which writes to the output buffer.

@vaxerski
Copy link
Member

I am a bit torn on the second one. That copy is very slow. Will it not lag into oblivion?

@PlasmaPower
Copy link
Contributor Author

It manages 55 fps on a 4k display on my system which is not great, not terrible. Mutter does the same copy from what I can see and I'm not aware of an alternative.

@vaxerski
Copy link
Member

It manages 55 fps on a 4k display on my system which is not great, not terrible. Mutter does the same copy from what I can see and I'm not aware of an alternative.

alright.

@ikalco
Copy link
Contributor

ikalco commented Feb 27, 2025

this should also fix #134 by using the copy path in your second point

@PlasmaPower
Copy link
Contributor Author

PlasmaPower commented Feb 27, 2025

I don't have the hardware to test it but I don't think it'll fix that one actually. In my case (two Nvidia GPUs) it was failing to create the from buffer which triggers the CPU copy fallback in this PR, but in the linked issue (an iGPU as primary + an Nvidia dGPU as secondary it sounds like?) it looks like it was failing to call glEGLImageTargetRenderbufferStorageOES on the to buffer from the logs. I'm not sure which Renderer blit is being called on in that case and which GPUs the buffers belong to, so I'm not sure what the correct fix for that issue would be, but it would probably build on the infrastructure in this PR.

@PlasmaPower
Copy link
Contributor Author

Fixed the merge conflict with #150

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

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

thanks!

@vaxerski vaxerski merged commit 09b3fd5 into hyprwm:main Mar 2, 2025
1 check passed
@PlasmaPower PlasmaPower deleted the nvidia-multi-gpu branch March 2, 2025 02:07
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.

3 participants