-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add Zink Override #8373
base: main
Are you sure you want to change the base?
Add Zink Override #8373
Conversation
Add Zink Override
I made a silly mistake while half asleep, but this change should target only those using nvidia proprietary drivers since nvidia-smi doesnt exist in nouveau/nvk |
Add Zink Override
* Add Zink Override Add Zink Override * Fix escape literals
@klylabs Thank you very much! I have a quick question, will this change affect non Nvidia users? Or Linux distributions are not using Wayland ? |
Really good point! In most cases, i imagine that this won’t really affect Intel or AMD users since nvidia-smi doesn’t exist for those drivers, but there could be edge cases on systems that have both an Intel/AMD iGPU and an NVIDIA dGPU (a smaller subset of existing nvidia users currently affected by the bug) , especially laptops or older PCs (since newer pcs with parts made after 2012/2013 properly support vulkan so even if Zink somehow gets triggered, it shouldn't really affect them that negatively, if at all, it could even boost performance) For example, someone with a Sandy Bridge CPU (2nd Gen Intel) plus a modern NVIDIA card could run into issues if the Intel iGPU is used for rendering (since the iGPU doesn’t really support Vulkan) to fix that, we can take advantage of the fact that those people use DRI_PRIME to select the GPU renderer, so we are able to do something like:
This way, if DRI_PRIME is not set or is set to a non zero value, we can probably be sure that the original test would work as intended although i could see that there can be issues if they have a TRIPLE gpu setup, but then again, we could probably treat it as out of scope since just using a Dual GPU on linux from different manufacturers can be really flakey and it's something that those people who would run a Triple gpu setup probably already expect and know how to fix, some people sometimes even just fully bypass the issue altogether by disabling the iGPU on the bios itself and to check for wayland, we can just do something like:
And while we're at it, we can add an environment variable (e.g. ZINK_DISABLE_OVERRIDE) to let users disable Zink if they suspect it causes issues, and maybe even a ZINK_FORCE_OVERRIDE if they want to test the vulkan performance on their system |
export WEBKIT_DISABLE_DMABUF_RENDERER=1 | ||
if [ "\$XDG_SESSION_TYPE" = "wayland" ] && [ "\$ZINK_DISABLE_OVERRIDE" != "1" ]; then | ||
if command -v glxinfo >/dev/null 2>&1; then | ||
RENDERER=\$(glxinfo | grep "OpenGL renderer string:" | sed 's/.*: //') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hesitant in using glxinfo at first since i wasn't sure if it's installed everywhere, so i thought at first to just check for prime, but in the end i just decided to use glxinfo since according to freedesktop.org "glxinfo should be installed by default by all (desktop) distributions." which, for those that don't know is one of the big boys in the linux world that sets everything that makes desktops and apps mesh together
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still very much open to check other ways of achieving the same thing though
Description
Implements #8372
solves
#8361
#8337
#8145
#8050
#8030
#7937
#4935
and probably many more
Screenshots/Recordings/Graphs
NA
Tests
Tested on Latest Ubuntu under a VM with GPU passthrough using nvidia-dkms-560 drivers
and Latest arch using nvidia-open-dkms 570.86.16-2