Primusrun Games lag on Gnome + Bumblebee

Problem:

The problem is when I lunch any game on steam using primusrun %command% the game launches with approximately 60 FPS but lags. Every couple of seconds and every time I move the selection to another button in the game's menu the game freezes for a second or so. I haven't had this issue when I was using a different OS so this is not a hardware problem.

Config:

I am using an Acer laptop with Manjaro Gnome. Graphics drivers configured as shown in the picture.
Screenshot%20from%202018-12-20%2001-35-43
mhwd shows:

[tomasz@tomasz-pc ~]$ mhwd -li
> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
         network-r8168            2016.04.20                true            PCI
video-hybrid-intel-nvidia-bumblebee            2018.08.09               false            PCI


Warning: No installed USB configs!

When I run $ primusrun glxgears there are no problems and I can see a process running on the graphics card with nvidia-smi.

[tomasz@tomasz-pc ~]$ nvidia-smi
Thu Dec 20 01:41:33 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 415.22       Driver Version: 415.22       CUDA Version: 10.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 960M    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   55C    P0    N/A /  N/A |     11MiB /  4046MiB |      2%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0     11642      G   glxgears                                       3MiB |
|    0     11651      G   /usr/lib/Xorg                                  6MiB |
+-----------------------------------------------------------------------------+

So it seems like the drivers are configured correctly.

The problem again but with context:

The problem is when I lunch any game on steam using primusrun %command% the game launches with approximately 60 FPS but lags. Every couple of seconds and every time I move the selection to another button in the game's menu the game freezes for a second or so. I haven't had this issue when I was using a different OS so this is not a hardware problem.

Specs:

[tomasz@tomasz-pc ~]$ inxi -Fx
System:
  Host: tomasz-pc Kernel: 4.19.8-2-MANJARO x86_64 bits: 64 compiler: gcc 
  v: 8.2.1 Desktop: Gnome 3.30.2 Distro: Manjaro Linux 
Machine:
  Type: Laptop System: Acer product: Aspire VN7-591G v: V1.15 
  serial: <root required> 
  Mobo: Acer model: Aspire VN7-591G v: V1.15 serial: <root required> 
  UEFI: Insyde v: 1.15 date: 08/06/2015 
Battery:
  ID-1: BAT0 charge: 36.6 Wh condition: 36.6/52.5 Wh (70%) 
  model: LGC AC14A8L status: Full 
CPU:
  Topology: Dual Core model: Intel Core i5-4210H bits: 64 type: MT MCP 
  arch: Haswell rev: 3 L2 cache: 3072 KiB 
  flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 23156 
  Speed: 962 MHz min/max: 800/3500 MHz Core speeds (MHz): 1: 1750 2: 1731 
  3: 1738 4: 1665 
Graphics:
  Device-1: Intel 4th Gen Core Processor Integrated Graphics 
  vendor: Acer Incorporated ALI driver: i915 v: kernel bus ID: 00:02.0 
  Device-2: NVIDIA GM107M [GeForce GTX 960M] driver: N/A bus ID: 01:00.0 
  Display: x11 server: X.org 1.20.3 driver: none 
  resolution: <xdpyinfo missing> 
  OpenGL: renderer: Mesa DRI Intel Haswell Mobile v: 4.5 Mesa 18.2.6 
  direct render: Yes 
Audio:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio 
  vendor: Acer Incorporated ALI driver: snd_hda_intel v: kernel 
  bus ID: 00:03.0 
  Device-2: Intel 8 Series/C220 Series High Definition Audio 
  vendor: Acer Incorporated ALI driver: snd_hda_intel v: kernel 
  bus ID: 00:1b.0 
  Sound Server: ALSA v: k4.19.8-2-MANJARO 
Network:
  Device-1: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter 
  vendor: Lite-On driver: ath10k_pci v: kernel port: 5040 bus ID: 07:00.0 
  IF: wlp7s0 state: up mac: 5c:93:a2:9b:cc:51 
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  driver: r8168 v: 8.045.08-NAPI port: 3000 bus ID: 08:00.0 
  IF: enp8s0 state: down mac: 30:65:ec:72:78:6f 
Drives:
  Local Storage: total: 931.51 GiB used: 235.29 GiB (25.3%) 
  ID-1: /dev/sda vendor: Western Digital model: WD10JPVX-22JC3T0 
  size: 931.51 GiB 
Partition:
  ID-1: / size: 906.94 GiB used: 235.28 GiB (25.9%) fs: ext4 dev: /dev/sda2 
  ID-2: swap-1 size: 8.80 GiB used: 7.8 MiB (0.1%) fs: swap dev: /dev/sda3 
Sensors:
  System Temperatures: cpu: 58.0 C mobo: N/A 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 264 Uptime: 48m Memory: 7.71 GiB used: 3.19 GiB (41.4%) 
  Init: systemd Compilers: gcc: 8.2.1 clang: 7.0.0 Shell: bash v: 4.4.23 
  inxi: 3.0.28 

can you optirun/primusrun inxi -Gxxz and post output so we can see what drivers are being used.

also
systemctl status bumblebeed

[tomasz@tomasz-pc ~]$ inxi -Gxxz
Graphics:
  Device-1: Intel 4th Gen Core Processor Integrated Graphics 
  vendor: Acer Incorporated ALI driver: i915 v: kernel bus ID: 00:02.0 
  chip ID: 8086:0416 
  Device-2: NVIDIA GM107M [GeForce GTX 960M] driver: N/A bus ID: 01:00.0 
  chip ID: 10de:139b 
  Display: x11 server: X.org 1.20.3 driver: none compositor: gnome-shell 
  resolution: <xdpyinfo missing> 
  OpenGL: renderer: Mesa DRI Intel Haswell Mobile v: 4.5 Mesa 18.2.6 
  compat-v: 3.0 direct render: Yes 
[tomasz@tomasz-pc ~]$  systemctl status bumblebeed
● bumblebeed.service - Bumblebee C Daemon
   Loaded: loaded (/usr/lib/systemd/system/bumblebeed.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2018-12-20 16:54:00 CET; 40min ago
 Main PID: 621 (bumblebeed)
    Tasks: 1 (limit: 4915)
   Memory: 46.7M
   CGroup: /system.slice/bumblebeed.service
           └─621 /usr/bin/bumblebeed --use-syslog

Dec 20 17:26:33 tomasz-pc bumblebeed[621]: [XORG] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
Dec 20 17:26:33 tomasz-pc bumblebeed[621]: [XORG] (WW) NVIDIA(0): Unable to get display device for DPI computation.
Dec 20 17:26:33 tomasz-pc bumblebeed[621]: [XORG] (WW) NVIDIA(0): Option "NoLogo" is not used
Dec 20 17:26:33 tomasz-pc bumblebeed[621]: [XORG] (EE) kbd: <default keyboard>: failed to set us as foreground pgrp (Inappropriate ioctl for device)
Dec 20 17:29:30 tomasz-pc bumblebeed[621]: [XORG] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi".
Dec 20 17:29:30 tomasz-pc bumblebeed[621]: [XORG] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi".
Dec 20 17:29:30 tomasz-pc bumblebeed[621]: [XORG] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
Dec 20 17:29:30 tomasz-pc bumblebeed[621]: [XORG] (WW) NVIDIA(0): Unable to get display device for DPI computation.
Dec 20 17:29:30 tomasz-pc bumblebeed[621]: [XORG] (WW) NVIDIA(0): Option "NoLogo" is not used
Dec 20 17:29:30 tomasz-pc bumblebeed[621]: [XORG] (EE) kbd: <default keyboard>: failed to set us as foreground pgrp (Inappropriate ioctl for device)

I have installed mutter-781835 and it seems to have fixed the problem. But I still have no idea if everything is configured properly.

no, i meant like this, so it will enable the nvidia when running inxi.
primusrun inxi -Gxxz
or
optirun inxi -Gxxz

[tomasz@tomasz-pc ~]$  primusrun inxi -Gxxz
Graphics:
  Device-1: Intel 4th Gen Core Processor Integrated Graphics 
  vendor: Acer Incorporated ALI driver: i915 v: kernel bus ID: 00:02.0 
  chip ID: 8086:0416 
  Device-2: NVIDIA GM107M [GeForce GTX 960M] driver: N/A bus ID: 01:00.0 
  chip ID: 10de:139b 
  Display: x11 server: X.org 1.20.3 driver: none compositor: gnome-shell 
  resolution: <xdpyinfo missing> 
  OpenGL: renderer: GeForce GTX 960M/PCIe/SSE2 v: 4.6.0 NVIDIA 415.25 
  direct render: Yes 

Sorry about that.

I have noticed one thing.
The problem does not occur after boot. When I turn on my laptop and go straight to steam and lunch any game it works without a problem. But when I use it for a while and then lunch a game the problem starts. Discord and steam run all the time and I also use Firefox.
I have noticed that when I have Firefox open games lag and when I close it completely they still do, but when I reboot and do not lunch Firefox they do not.

have you changed anything, installed/removed drivers?
i use prime for my optimus lappy, the only experience i have with BB is watching it fail to work properly. i would think when you primusrun inxi it would show the correct drivers but im not 100% sure. there is abumblebee troubleshooting thread you could read through that would probably be of more help to you than i.
from google/ddg i came across someone with the same errors and it was due to tlp not letting the gpu work properly. its easy enough to check by disabling tlp temporarily .

sudo systemctl stop tlp
sudo systemctl disable tlp
reboot and run some tests and see if the behavior is gone. if it is i think its safe to say it was TLP.

1 Like

Thanks
I will definitely try it out.

1 Like

This solution was working fine for kernel 4.19. I have recently updated to 4.20 and the problem exists again.

1 Like

if 4.19 works, use it. 4.20 is still fairly new and just because 4.20 is out it doesnt mean you have to use it

I have done some reading and testing and for now, using optimus-manager is a nice workaround. It is quite easy to use if you refer to the wiki. The idea is to switch to the more powerful GPU while playing games or so and to use less powerful one otherwise.
Also using the previous solution I had about 40 FPS while playing Rocket League and right now I have 70. I know that this is not the desired solution but it works quite well.

i might try giving optimus manager another go, maybe on a test install. i tried it once (briefly) and i couldnt get it working right but that was probably a "me" problem more than it was and "optimus-manager" one. glad you were able to get it going.
as far as bumblebee goes, i actually got it to work on the openbox install im on now but i really dont ever intend on doing anything needing the dGPU, if i did i would go with prime like i have on my kde install or maybe optimus-manager.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by