You are not logged in.

#1 2021-10-30 05:41:09

Kamey
Member
From: Serbia
Registered: 2020-12-07
Posts: 44

[Solved] PRIME GPU offloading doesn't work

I have an Optimus Laptop and I've been trying to setup PRIME GPU offloading for quite a while now
I have installed nvidia driver and kernel modules, nvidia shows properly in xrandr --listproviders

Providers: number : 2
Provider 0: id: 0x45 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 3 associated providers: 0 name:modesetting
Provider 1: id: 0x2ea cap: 0x0 crtcs: 0 outputs: 0 associated providers: 0 name:NVIDIA-G0

but when I try doing xrandr --setprovideroffloadsink 1 0 I get the following

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  34 (RRSetProviderOffloadSink)
  Value in failed request:  0x2ea
  Serial number of failed request:  16
  Current serial number in output stream:  17

While launching programs with prime-run does work properly, I'm unsure as to what is the cause of all this and If I'm doing something incorrectly?

Last edited by Kamey (2021-10-30 09:53:23)


CPU: Intel i7-4790 (8) @ 4.000GHz
RAM: 16GB DDR3
GPU: Intel HD 4600
DE: Mate

Offline

#2 2021-10-30 07:02:33

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,979

Re: [Solved] PRIME GPU offloading doesn't work

The GPU is a mere 3D accelerator w/o source or sink, you cannot (and don't have to) offload anything.
What's the output of

lspci
prime-run glxinfo -B

?

Online

#3 2021-10-30 08:30:07

Kamey
Member
From: Serbia
Registered: 2020-12-07
Posts: 44

Re: [Solved] PRIME GPU offloading doesn't work

[kamey@asus ~]$ lspci
00:00.0 Host bridge: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Host Bridge (rev 0b)
00:00.1 Signal processing controller: Intel Corporation Device 5a8c (rev 0b)
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 500 (rev 0b)
00:0e.0 Audio device: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster (rev 0b)
00:0f.0 Communication controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Trusted Execution Engine (rev 0b)
00:12.0 SATA controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SATA AHCI Controller (rev 0b)
00:13.0 PCI bridge: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #1 (rev fb)
00:13.1 PCI bridge: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #2 (rev fb)
00:14.0 PCI bridge: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port B #1 (rev fb)
00:15.0 USB controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series USB xHCI (rev 0b)
00:16.0 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #1 (rev 0b)
00:17.0 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #5 (rev 0b)
00:1f.0 ISA bridge: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Low Pin Count Interface (rev 0b)
00:1f.1 SMBus: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SMBus Controller (rev 0b)
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL810xE PCI Express Fast Ethernet controller (rev 07)
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter
03:00.0 3D controller: NVIDIA Corporation GK107M [GeForce 810M] (rev a1)
03:00.1 Audio device: NVIDIA Corporation GK107 HDMI Audio Controller (rev a1)
[kamey@asus ~]$ prime-run glxinfo -B
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 2048 MB
    Total available memory: 2048 MB
    Currently available dedicated video memory: 1996 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce 810M/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 470.74
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6.0 NVIDIA 470.74
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 470.74
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

I'm unsure what do you mean by that, could you please explain.. thanks!
I though it is necessary to offload because I want to be able to run display and everything else such as web browser using the integrated GPU, but when I run a game such as Minecraft I want it to be able to use NVIDIA GPU properly, although I was able to get it running via prime-run command, It would be nice if I could just open the game without the need of running it with prime-run from terminal every time, just like how windows 10 handles it automatically.

and of course my laptop isn't the best when it comes to specifications, but it runs smoothly on my lightweight arch install, There's no lag whatsoever and retro games, or less demanding ones run absolutely fine, I game rarely anyway so I wont be using NVIDIA GPU nearly as much, but it's nice to have everything working as it should, that's why I'm trying to set up everything correctly.

Last edited by Kamey (2021-10-30 08:34:10)


CPU: Intel i7-4790 (8) @ 4.000GHz
RAM: 16GB DDR3
GPU: Intel HD 4600
DE: Mate

Offline

#4 2021-10-30 09:31:25

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,979

Re: [Solved] PRIME GPU offloading doesn't work

Kamey wrote:

I'm unsure what do you mean by that, could you please explain.. thanks!

Output redirection tells the GPU to not (only) send the output to its crtcs, but (also) to another GPU to have it forward to the outputs atached to latter.
Your nvidia chip can't display anything by itself and has to use the IGP for the actual output - ghs is wired in the HW and you don't have to worry about it.
If "glxinfo -B" (w/o prime-run) tells you that you're using the intel chip, the desktop session runs on the intel chip and the nvidia one is only invoked w/ prime-run.


Kamey wrote:

It would be nice if I could just open the game without the need of running it with prime-run from terminal every time, just like how windows 10 handles it automatically

That's not a thing beause computers don't work by magic. The game on windows installs an application profile or a startmenu link that starts it using the equivalent of prime-run. There's no automatism where windows knows "oh, this is the latest version of SuperTurboTurkeyPuncher³ - I better use the nvidia GPU". Somebody else has just made this decision for you. You can invoke prime-run in the desktop service file of the aplication or your runner (depending on what that is and how it executes commands) or wrap it into a (shadowing) shell script, eg. /usr/local/bin/doom calling "prime-run /usr/bin/doom"

Online

#5 2021-10-30 09:52:33

Kamey
Member
From: Serbia
Registered: 2020-12-07
Posts: 44

Re: [Solved] PRIME GPU offloading doesn't work

Output redirection tells the GPU to not (only) send the output to its crtcs, but (also) to another GPU to have it forward to the outputs atached to latter.
Your nvidia chip can't display anything by itself and has to use the IGP for the actual output - ghs is wired in the HW and you don't have to worry about it.
If "glxinfo -B" (w/o prime-run) tells you that you're using the intel chip, the desktop session runs on the intel chip and the nvidia one is only invoked w/ prime-run.

Oh that makes sense, thanks for explaining.

That's not a thing beause computers don't work by magic. The game on windows installs an application profile or a startmenu link that starts it using the equivalent of prime-run. There's no automatism where windows knows "oh, this is the latest version of SuperTurboTurkeyPuncher³ - I better use the nvidia GPU". Somebody else has just made this decision for you. You can invoke prime-run in the desktop service file of the aplication or your runner (depending on what that is and how it executes commands) or wrap it into a (shadowing) shell script, eg. /usr/local/bin/doom calling "prime-run /usr/bin/doom"

Oh I see, I though it was automatically detecting higher end gpu, because it would always use nvidia for games, but I guess I was wrong.
So yeah that's what I will do, I will add prime-run parameter into the application launcher.

Last edited by Kamey (2021-10-30 09:53:02)


CPU: Intel i7-4790 (8) @ 4.000GHz
RAM: 16GB DDR3
GPU: Intel HD 4600
DE: Mate

Offline

Board footer

Powered by FluxBB