-
Notifications
You must be signed in to change notification settings - Fork 379
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
How to choose discrete gpu on optimus laptop? #394
Comments
Hi, I am not exactly sure. |
I found it out yesterday. The container does install the Nvidia driver, yes. What I did was set the same environment variables as this script (originally part of the nvidia-prime arch linux package): https://github.com/archlinux/svntogit-packages/blob/packages/nvidia-prime/trunk/prime-run Setting these variables in the container makes applications run on the Nvidia card. By the way: With Nvidia 490 supporting GBM as well as Gnome 41 having support for Nvidia's GBM path, x11docker now works with Wayland and Xwayland, even on Nvidia! |
Thank you for the feedback! Great that you already found a solution. x11docker could set these variables if present in the environment and option
Interesting news. However this works only for the case Gnome>=41 and Nvidia>=490? |
The latest commit adds |
I bet it works on any Wayland compositor that uses Nvidia's GBM implementation. Right now I think that is KDE and Gnome (unsure about Sway and other Wlroots based ones).
This works, thank you! One thing though: Is there any way to bypass the fact that you need to have the same username inside the container as on the host for the GPU to work? This happens both for my integrated GPU and discrete GPU. When not using prime-run having a different username leads to software rendering (llvmpipe), while with prime-run nothing works. |
The container user chosen with option In which setup does |
I have added a check for NVIDIA>=470.x and Xwayland>=21.1.2 that should support Wayland and Xwayland setups with NVIDIA cards.
This should not happen and I'd still be interested to hear more about this. Can you give me an example? |
Sorry for the late reply, totally forgot about this! My command is: |
No, you are right. I meant to have
Thank you for the tip.
I know. I'm not using containers to actually containerize applications. I'm using it to run programs that would otherwise be troublesome to run on my distro, and it needs access to all ports on my system. In my mind using host network is no more dangerous than running a program outside of a container, which I would do if I could. |
Thank you, I found a bug! Though, it caused to fail X access independent from |
Hi,
I have a laptop with an integrated Intel GPU and a discrete Nvidia GPU. I have set up the Nvidia driver to work with x11docker, but how do I make applications in a container actually use the Nvidia card and not the Intel one?
The text was updated successfully, but these errors were encountered: