NVIDIA / open-gpu-kernel-modules

NVIDIA Linux open GPU kernel module source
Other
15.06k stars 1.25k forks source link

Night light does not work in GNOME Wayland (missing GAMMA_LUT support) #162

Closed Gert-dev closed 2 months ago

Gert-dev commented 2 years ago

NVIDIA Driver Version 515.43.04

GPU NVIDIA RTX 2070 Super Max-Q

Describe the bug Enabling night light in GNOME has no effect.

This bug also exists with the proprietary driver, but also seems to exist with the new, open, driver (hence this report).

To Reproduce

  1. Enable night light in GNOME 42.1 on Wayland.
  2. Set the time so that it is currently active.
  3. Set the intensity high enough to be noticeable (warm).
  4. Observe nothing happening.

Expected behavior The night light works as intended by making the colours of the screen warmer.

Please reproduce the problem, run nvidia-bug-report.sh, and attach the resulting nvidia-bug-report.log.gz.

nvidia-bug-report.log.gz

Newbytee commented 2 years ago

Upstream bug report: https://gitlab.gnome.org/GNOME/mutter/-/issues/290

santhosh-reddy03 commented 1 year ago

Hi Team, I am facing this issue on x11 as well, when i click on the night light and move the slider, it turns on for a movement and exits from there, there after. Nvidia Driver Version: 515.65.01 Please look into this issue at the earliest possible time.

pyt0xic commented 1 year ago

Not sure if it helps but Gammastep works flawlessly for me with wlroots compositors. Maybe worth a look...

MahouShoujoMivutilde commented 1 year ago

@pyt0xic could you tell me more about your system?

I am on 520.56.06 proprietary driver (pre-turing gpu), but I would expect that gammastep would either work on both or fail on both since "This code base is shared with NVIDIA's proprietary drivers" (from readme).

Hyprland compositor.

Launching gammastep -m wayland -PO 2600 gives

Warning: Zero outputs support gamma adjustment.
Warning: 1/1 output(s) do not support gamma adjustment.

Tried on sway too (same result).

What compositor do you use?

pyt0xic commented 1 year ago

I was using Sway and am now running Hyprland. I have an Optimus laptop but usually force dGPU.

I'll add more once I'm back from work. But maybe double check all your Wayland related env vars.

MahouShoujoMivutilde commented 1 year ago

I don't see any issues with my environment variables

export _JAVA_AWT_WM_NONREPARENTING=1
export XCURSOR_SIZE=24

# fix nvidia
export LIBVA_DRIVER_NAME=nvidia
export XDG_SESSION_TYPE=wayland
export GBM_BACKEND=nvidia-drm
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export WLR_NO_HARDWARE_CURSORS=1
export QT_QPA_PLATFORM=wayland

export SDL_VIDEODRIVER=wayland
export MOZ_ENABLE_WAYLAND=1

$WAYLAND_DISPLAY is visible to gammastep, idk what else it could possibly need.

Are you sure you are running the compositor on dGPU? Because that's would neatly explain why it works for you.

What is the output of glxinfo | grep "OpenGL renderer" for you?

Theoretically, you also might have any of $WLR_RENDERER, $WLR_RENDER_DRM_DEVICE, $WLR_DRM_DEVICES set to override GPU used or select e.g. vulkan as render backend. Do you?

https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/master/docs/env_vars.md#wlroots-specific

Also, I noticed that Hyprland logs which gpu is used.

What's the output of grep -C 2 'GPU information' /tmp/hypr/*/*.log?

yannjor commented 1 year ago

I was using Sway and am now running Hyprland. I have an Optimus laptop but usually force dGPU.

I'll add more once I'm back from work. But maybe double check all your Wayland related env vars.

@pyt0xic Could you please share your env vars?

LukasF1337 commented 1 year ago

It is a known missing feature that GAMMA_LUT is not implemented in nvidias wayland driver yet: http://us.download.nvidia.com/XFree86/Linux-x86_64/525.89.02/README/wayland-issues.html which will be implemented at some point in the future according to their site. @santhosh-reddy03 on my system setting the gamma LUT on X11 in KDE Plasma works.

santhosh-reddy03 commented 1 year ago

Actually somehack from ubuntu launchpad bugs helped me fix the issue, i don't remember the variable name but on setting it to false, everything worked as usual, and glad to know nvidia is on it , hope to see in some time in future.

rwjack commented 1 year ago

@santhosh-reddy03 well which variable was it?

santhosh-reddy03 commented 1 year ago

@rwjack there were two issues, the pc was also not waking up from sleep, i think its Ubuntu 22.04 specific issue in my case, i m attaching the bug link here, it has worked for me at that time, since then i switched back to x11.

rwjack commented 1 year ago

Yeah I'm switching back to x11 until I get a new GPU.

MahouShoujoMivutilde commented 1 year ago

I am not using gnome, but if there is some software that lets you draw your own custom shader as an overlay for the whole screen - you can make your own night light.

In hyprland there is an option for that

# hyprland.conf

decoration {
    screen_shader = ~/.config/hypr/your-shader.glsl
}

Here is the shader I use

https://github.com/hyprwm/Hyprland/issues/1140#issuecomment-1335128437

Result: No shader: ![01-03-2023-02_00_41](https://user-images.githubusercontent.com/14999778/222002059-46f14077-f164-4793-b4e9-de839ab7b234.jpg) Shader: ![01-03-2023-02_00_47](https://user-images.githubusercontent.com/14999778/222002029-a38e4ea8-70d8-426d-8778-44ee8f298dbf.jpg)

It is trivial to automate it to apply on sunset.

Idk if gnome can do custom shaders, maybe ask the devs nicely to make a fallback implementation for nightlight if nvidia gpu is detected on wayland, because it doesn't seem like GAMMA_LUT will happen on nvidia any time soon.

eszlari commented 1 year ago

One year ago a Nvidia dev wrote:

Support for GAMMA_LUT is in the queue, but no ETA at the moment.

https://github.com/Plagman/gamescope/pull/454#issuecomment-1076680841

eszlari commented 1 year ago

https://forums.developer.nvidia.com/t/nvidia-bug-kde-wayland-games-are-force-vsynced/237880/3

Work on Gamma LUT support is also in progress. The implementation is currently under internal code-review.

rwjack commented 1 year ago

Yeah, that quote is from the 28th of December 2022.

aviallon commented 1 year ago

@rwjack Finally!

The vsync issue will be fixed in the 545 driver release. Unfortunately I wasn’t able to get it in in time for the 535 release which will go public in a few days, sorry. But 545 will be the next release after that (we’re skipping 540 for whatever reason).

https://forums.developer.nvidia.com/t/nvidia-bug-kde-wayland-games-are-force-vsynced/237880/21

Newbytee commented 1 year ago

@rwjack Finally!

The vsync issue will be fixed in the 545 driver release. Unfortunately I wasn’t able to get it in in time for the 535 release which will go public in a few days, sorry. But 545 will be the next release after that (we’re skipping 540 for whatever reason).

https://forums.developer.nvidia.com/t/nvidia-bug-kde-wayland-games-are-force-vsynced/237880/21

How is this related to night light/GAMMA_LUT?

rwjack commented 1 year ago

How is this related to night light/GAMMA_LUT?

Just Nvidia smokescreen trying to keep us onboard :joy:

aviallon commented 1 year ago

@rwjack Finally!

The vsync issue will be fixed in the 545 driver release. Unfortunately I wasn’t able to get it in in time for the 535 release which will go public in a few days, sorry. But 545 will be the next release after that (we’re skipping 540 for whatever reason).

https://forums.developer.nvidia.com/t/nvidia-bug-kde-wayland-games-are-force-vsynced/237880/21

How is this related to night light/GAMMA_LUT?

Sadly, the two subjects were discussed at the same time in the same thread. And I misread 😢

eszlari commented 1 year ago

Plasma 6 will support night color on Nvidia without GAMMA_LUT:

https://invent.kde.org/plasma/kwin/-/merge_requests/4130

zefr0x commented 1 year ago

Plasma 6 will support night color on Nvidia without GAMMA_LUT:

https://invent.kde.org/plasma/kwin/-/merge_requests/4130

It uses a shader based fallback. It's just a work around, not an actual support.

It is not efficient and I think that colours will be also different when capturing the screen, since it's not a GPU side based solution (didn't test it in KWin, I'm not 100% sure).

Sohail-XD commented 1 year ago

@MahouShoujoMivutilde this worked thanks, btw can I get dots for the bar in your picture?

MahouShoujoMivutilde commented 1 year ago

@Sohail-XD The bar evolved since then, here is how the current one looks:

Waybar ![05-07-2023-23_33_54](https://github.com/NVIDIA/open-gpu-kernel-modules/assets/14999778/969882bf-8621-470d-87f3-d0a181d491e5)

configs:

waybar/config ```jsonc // vim: set ft=jsonc: { "layer": "top", "position": "top", // Waybar position (top|bottom|left|right) "height": 30, // Waybar height (to be removed for auto height) // "width": 1280, // Waybar width "spacing": 0, // Gaps between modules (set in style.css for mor precision) "modules-left": [ "cpu", "wlr/workspaces" ], "modules-center": [ "hyprland/window" ], "modules-right": [ "custom/isrecording", "custom/nvtemp", "custom/cputemp", "custom/memory", "idle_inhibitor", "pulseaudio", "bluetooth", "hyprland/language", "custom/sunset", "clock", "tray", "custom/notification" ], "idle_inhibitor": { "format": "{icon}", "format-icons": { "activated": "", "deactivated": "" } }, "cpu": { "interval": 1, // cores including HT "format": "{icon0} {icon1} {icon2} {icon3} {icon4} {icon5} {icon6} {icon7} {icon8} {icon9} {icon10} {icon11} {icon12} {icon13} {icon14} {icon15}", "format-icons": [ "▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" ], }, "custom/isrecording": { "exec": "isrecording", "interval": 1 }, "custom/memory": { "exec": "~/.config/waybar/scripts/waybar-mem", "interval": 1 }, "custom/nvtemp": { "format": "3D {} °C", "exec": "nvtemp 65", "interval": 2 }, "custom/cputemp": { "format": "CPU {} °C", "exec": "cputemp 60", "interval": 2 }, "wlr/workspaces": { "format": "{name}", "on-click": "activate", "sort-by-number": true }, "bluetooth": { "format": " {status}", "format-on": "", "format-off": "", "format-disabled": "", "format-connected": " {device_alias}", "format-connected-battery": "{device_battery_percentage}%  ", "tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected", "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}", "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", "tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%" }, "hyprland/language": { "format": " {}", "format-en": "us", "format-ru": "ru", "keyboard-name": "logitech-usb-keyboard" }, "hyprland/window": { "format": "{}", "separate-outputs": true }, "custom/sunset": { "format": "🌇 {}", "exec": "~/.config/waybar/scripts/sunset", "restart-interval": 1 }, "tray": { // "icon-size": 21, "spacing": 10 }, "clock": { // "tooltip-format": "{:%Y %B}\n{calendar}", "format": " {:%H:%M (%A) %d %b %Y}", // "format": " {:%H:%M}", "tooltip-format": " {:%H:%M (%A) %d %b %Y}", "on-click": "foot -W 70x35 -H -a floatme -T Calendar cal -y", "calendar": { // "mode": "year", "mode-mon-col": 3, "weeks-pos": "right", "on-scroll": 1, // "on-click-right": "mode", "format": { "months": "{}", "days": "{}", "weeks": "W{}", "weekdays": "{}", "today": "{}" } } }, "pulseaudio": { // "scroll-step": 1, // %, can be a float "format": "{icon} {volume}%", "format-bluetooth": " {icon} {volume}%", "format-bluetooth-muted": " ", "format-muted": "", "format-source": "{volume}% ", "format-source-muted": "", "format-icons": { "default": [ "", "" ] }, "on-click": "pavucontrol" }, "custom/notification": { "tooltip": false, "format": "{icon}", "format-icons": { "notification": "", "none": "", "dnd-notification": "", "dnd-none": "", "inhibited-notification": "", "inhibited-none": "", "dnd-inhibited-notification": "", "dnd-inhibited-none": "" }, "return-type": "json", "exec-if": "which swaync-client", "exec": "swaync-client -swb", // sleep is here as workaround for // https://github.com/Alexays/Waybar/issues/1968 "on-click": "sleep 0.1 && swaync-client -t -sw", "on-click-right": "swaync-client -d -sw", "escape": true } } ```
waybar/style.css ```css * { border: none; border-radius: 0; font-family: Monospace; font-size: 14px; /* min-height: 24px; */ } window#waybar { background: transparent; } window#waybar.hidden { opacity: 0.2; } /* hide when no window is selected */ /* window#waybar.empty #window for v0.9.20+ */ #window.empty { background: transparent; } /* #window { */ /* margin-bottom: 8px; */ /* padding-left: 16px; */ /* padding-right: 16px; */ /* border-radius: 26px; */ /* transition: none; */ /* background: rgba(27, 22, 22, 0.85); */ /* } */ #workspaces { margin-bottom: 4px; margin-top: 4px; margin-left: 3px; border-radius: 26px; background: rgba(27, 22, 22, 0.65); transition: none; } #workspaces button { transition: none; color: #f8e1e1; background: transparent; font-size: 16px; } #workspaces button.active { color: #f8e1e1; background: rgba(154, 237, 254, 0.2); border-radius: 26px; } #workspaces button.urgent { color: #f8e1e1; background: rgba(154, 237, 254, 1); border-radius: 26px; } #clock, #language, #pulseaudio, #tray, #window, #bluetooth, #custom-isrecording, #custom-memory, #idle_inhibitor, #cpu, #custom-cputemp, #custom-sunset, #custom-clock, #custom-notification, #custom-nvtemp { margin-bottom: 4px; margin-top: 4px; padding-left: 16px; padding-right: 16px; /* border-radius: 26px; */ transition: none; color: #f8e1e1; background: rgba(27, 22, 22, 0.85); /* background: rgba(32, 49, 45, 1); */ } /* borders: (---] */ #idle_inhibitor { margin-left: 6px; border-radius: 26px 0px 0px 26px; } /* borders: [---) */ #custom-notification { margin-right: 7px; border-radius: 0px 26px 26px 0px; } /* Transient (right) */ /* borders: (---) */ #custom-isrecording, #custom-memory, #custom-cputemp, #custom-nvtemp, /* just round things */ #cpu, #window { margin-left: 7px; margin-right: 7px; border-radius: 26px; } #window { font-family: Sans; background: rgba(65, 8, 145, 0.45) } #bluetooth { /* font-family: Monospace; */ font-size: 12px; /* background: rgba(27, 22, 255, 0.65); */ background: rgba(7, 30, 49, 0.85); } #idle_inhibitor.activated { color: #bc8b3c; } ```
mirh commented 11 months ago

GAMMA_LUT landed in the first R545 beta

C0rn3j commented 11 months ago

Link to the driver in question - https://www.nvidia.com/download/driverResults.aspx/212964/en-us/

This actually fixes many of the remaining (X)Wayland issues.

Great job Nvidia!

EDIT: Nvidia now keeps track of the remaining Wayland issues here https://forums.developer.nvidia.com/t/wayland-information-for-r545-beta-release/214275

NTsch commented 11 months ago

It's out of Beta now: https://www.nvidia.com/download/driverResults.aspx/214100/en-us/

gilvbp commented 11 months ago

Link to the driver in question - https://www.nvidia.com/download/driverResults.aspx/212964/en-us/

This fixes many of the remaining (X)Wayland issues.

Great job Nvidia!

EDIT: Nvidia now keeps track of the remaining Wayland issues here https://forums.developer.nvidia.com/t/wayland-information-for-r545-beta-release/214275

Yes! There is a lot of improvement! But it still missing the multi-GPU mosaic support! But it's on track here:

https://github.com/NVIDIA/egl-wayland/issues/91#issuecomment-1785740677

Gert-dev commented 2 months ago

Closing this since I have hardware again that has this setup and it's fixed for me now using GNOME and recent NVIDIA drivers. I can successfully use night light now on Wayland.

exil0867 commented 2 months ago

Also fixed on the latest version of KDE Plasma.