Askannz / optimus-manager

A Linux program to handle GPU switching on Optimus laptops.
MIT License
2.3k stars 170 forks source link

nvidia mode is choppy while hybrid mode appears to have more performance. #498

Open DrunkenToast opened 2 years ago

DrunkenToast commented 2 years ago

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
heddxh commented 2 years ago

Without Optimus-manager still encounters this problem, for me it is i+n graphic cards. Tested by glmark2, Intel gets 3500 compared to 1500 on prime-run glmark2. So maybe it isn’t Optimus-manager’s problem.