Repository: Askannz/optimus-manager

Issue #498: nvidia mode is choppy while hybrid mode appears to have more performance.
Created: 2022-06-05T10:36:06Z
Describe the bug
Performance of the nvidia gpu is slower when ran with prime-run than my amd integrated gpu in hybrid mode.
However in dedicated nvidia mode it performs better.
I know some overhead is to be expected but this difference seems to be huge. Any mistake on my end?
System info
EndeavourOS
KDE 5.24.5
SDDM
Optimus Manager v1.4
Nvidia GPU: NVIDIA GeForce RTX 2060/PCIe/SSE2 (Mobile)
Driver Version: 515.43.04    CUDA Version: 11.7
CPU/iGPU: Amd Ryzen 7 4800H | AMD RENOIR (LLVM 13.0.1, DRM 3.46, 5.18.1-arch1-1)
Custom optimus-manager:
[amd]
DRI=3
driver=amdgpu
tearfree=

[intel]
DRI=3
accel=
driver=modesetting
modeset=yes
tearfree=

[nvidia]
DPI=96
PAT=yes
allow_external_gpus=no
dynamic_power_management=fine
dynamic_power_management_memory_threshold=0
ignore_abi=no
modeset=yes
options=overclocking

[optimus]
auto_logout=yes
pci_power_control=no
pci_remove=no
pci_reset=no
startup_auto_battery_mode=integrated
startup_auto_extpower_mode=nvidia
startup_mode=hybrid
switching=none

Logs
Optimus Manager (Client) version 1.4

Current GPU mode : hybrid
GPU mode requested for next login : no change
GPU at startup : hybrid
Temporary config path: no

Benchmarks
Hybrid iGPU amd:
=======================================================
    glmark2 2021.12
=======================================================
    OpenGL Information
    GL_VENDOR:      AMD
    GL_RENDERER:    AMD RENOIR (LLVM 13.0.1, DRM 3.46, 5.18.1-arch1-1)
    GL_VERSION:     4.6 (Compatibility Profile) Mesa 22.1.0
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 9009 FrameTime: 0.111 ms
[build] use-vbo=true: FPS: 11434 FrameTime: 0.087 ms
[texture] texture-filter=nearest: FPS: 9172 FrameTime: 0.109 ms
[texture] texture-filter=linear: FPS: 9194 FrameTime: 0.109 ms
[texture] texture-filter=mipmap: FPS: 8689 FrameTime: 0.115 ms
[shading] shading=gouraud: FPS: 7909 FrameTime: 0.126 ms
[shading] shading=blinn-phong-inf: FPS: 7385 FrameTime: 0.135 ms
[shading] shading=phong: FPS: 7280 FrameTime: 0.137 ms
[shading] shading=cel: FPS: 6927 FrameTime: 0.144 ms
[bump] bump-render=high-poly: FPS: 4851 FrameTime: 0.206 ms

Hybrid nvidia offloading with prime-run:
prime-run glmark2
=======================================================
    glmark2 2021.12
=======================================================
    OpenGL Information
    GL_VENDOR:      NVIDIA Corporation
    GL_RENDERER:    NVIDIA GeForce RTX 2060/PCIe/SSE2
    GL_VERSION:     4.6.0 NVIDIA 515.43.04
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 1968 FrameTime: 0.508 ms
[build] use-vbo=true: FPS: 2450 FrameTime: 0.408 ms
[texture] texture-filter=nearest: FPS: 2443 FrameTime: 0.409 ms
[texture] texture-filter=linear: FPS: 2428 FrameTime: 0.412 ms
[texture] texture-filter=mipmap: FPS: 2412 FrameTime: 0.415 ms
[shading] shading=gouraud: FPS: 2410 FrameTime: 0.415 ms
[shading] shading=blinn-phong-inf: FPS: 2417 FrameTime: 0.414 ms
[shading] shading=phong: FPS: 2384 FrameTime: 0.419 ms
[shading] shading=cel: FPS: 2388 FrameTime: 0.419 ms
[bump] bump-render=high-poly: FPS: 2278 FrameTime: 0.439 ms

Nvidia mode:
=======================================================
    glmark2 2021.12
=======================================================
    OpenGL Information
    GL_VENDOR:      NVIDIA Corporation
    GL_RENDERER:    NVIDIA GeForce RTX 2060/PCIe/SSE2
    GL_VERSION:     4.6.0 NVIDIA 515.43.04
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 4916 FrameTime: 0.203 ms
[build] use-vbo=true: FPS: 12187 FrameTime: 0.082 ms
[texture] texture-filter=nearest: FPS: 11470 FrameTime: 0.087 ms
[texture] texture-filter=linear: FPS: 11570 FrameTime: 0.086 ms
[texture] texture-filter=mipmap: FPS: 11874 FrameTime: 0.084 ms
[shading] shading=gouraud: FPS: 9848 FrameTime: 0.102 ms
[shading] shading=blinn-phong-inf: FPS: 10904 FrameTime: 0.092 ms
[shading] shading=phong: FPS: 10264 FrameTime: 0.097 ms
[shading] shading=cel: FPS: 10965 FrameTime: 0.091 ms
[bump] bump-render=high-poly: FPS: 9351 FrameTime: 0.107 ms

Duplicate issue #557: Nvidia mode significantly slower than other modes
Created: 2024-01-16T04:58:20Z
Describe the bug
When switching to nvidia the framerate drops a lot when compared to hybrid or integrated.
I tested using this: glmark2
System info
Please include :OS: Manjaro Linux x86_64
Host: ASUS TUF Gaming A15 FA506II_FA506II 1.0
Kernel: 6.7.0-0-MANJARO
Uptime: 13 mins
Packages: 1319 (pacman)
Shell: bash 5.2.21
Resolution: 1920x1080
DE: Plasma 5.27.10
WM: KWin
Theme: [Plasma], Breeze [GTK2/3]
Icons: [Plasma], breeze [GTK2/3]
Terminal: konsole
CPU: AMD Ryzen 7 4800H with Radeon Graphics (16) @ 2.900GHz
GPU: NVIDIA GeForce GTX 1650 Ti Mobile
GPU: AMD ATI Radeon RX Vega 6
Memory: 3655MiB / 31513MiB
optimus-manager --status                                                                                                                                                     ✔
Optimus Manager (Client) version 1.5
Current GPU mode : hybrid
GPU mode requested for next login : no change
GPU at startup : hybrid
Temporary config path: no
/etc/optimus-manager/optimus-manager.conf
#i tried a bunch of stuff. initially i was focused on decreasing power consumption but then i wanted to benchmark
[optimus]
startup_mode=hybrid
#startup_mode=integrated
#switching=nouveau
#pci_power_control=yes
#pci_remove=no
#pci_reset=no
#[nvidia]
#dynamic_power_management=fine
benchmarking results
hybrid
[build] use-vbo=false: FPS: 9311 FrameTime: 0.107 ms
[build] use-vbo=true: FPS: 10802 FrameTime: 0.093 ms
[texture] texture-filter=nearest: FPS: 8747 FrameTime: 0.114 ms
integrated
[build] use-vbo=false: FPS: 9463 FrameTime: 0.106 ms
[build] use-vbo=true: FPS: 10475 FrameTime: 0.095 ms
[texture] texture-filter=nearest: FPS: 8965 FrameTime: 0.112 ms
nvidia
[build] use-vbo=false: FPS: 2164 FrameTime: 0.462 ms
[build] use-vbo=true: FPS: 2667 FrameTime: 0.375 ms
[texture] texture-filter=nearest: FPS: 6234 FrameTime: 0.160 ms
i can hear the fan spin way faster and see the wattage rising in powertop  but in the end i get less frames. any idea why?
note:
i did change the /etc/sddm.conf file
[X11]
#DisplayCommand=/usr/share/sddm/scripts/Xsetup
#DisplayStopCommand=/usr/share/sddm/scripts/Xstop

Closing comment (2024-07-01T13:02:37Z): Closing as a duplicate of #498
It also might not be entirely related to optimus-manager but, please follow that other issue and post any findings there
Have a nice week.