Cannot use optimus-manager or other programs to launch a game using my NVIDIA GPU

I am running manjaro-i3 on my computer. I have tried optimus-manager, prime-run, optirun, DRI_PRIME=1 (and 0), and numerous other things. I cannot find an article anywhere online that matches my issue, so I am forced to post an article here if I want help.

When I run prime-run supertuxkart, I get the error:
I also get this error upon launching other games/programs with prime-run.

..:: Antarctica Rendering Engine 2.0 ::..
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  155 (NV-GLX)
  Minor opcode of failed request:  4 ()
  Resource id in failed request:  0x2600002
  Serial number of failed request:  106
  Current serial number in output stream:  106

prime-run minecraft-launcher has no errors, but upon launching the game I get ~5 FPS and pressing F3 shows that my nvidia gpu is nowhere to be found. (Gtx 1050 1GB) So clearly it is not using my GPU, as I would normally get around 150-200 fps on medium-high settings.

As far as I know, DRI_PRIME does not break anything, but also does not change anything.

Upon running optimus-manager --print-mode, I get:

ERROR: the latest GPU setup attempt failed at Xorg pre-start hook.
Log at /var/log/optimus-manager/switch/switch-20210529T110624.log
Cannot execute command because of previous errors.

Any attempt to use optirun to do anything produces this error, or something very similar if not the same:

[ 1546.578258] [ERROR]The Bumblebee daemon has not been started yet or the socket path /var/run/bumblebee.socket was incorrect.
[ 1546.578285] [ERROR]Could not connect to bumblebee daemon - is it running?

Please note I have also tried using stuff such as systemctl to restart, enable, and disable various services including bumblebee/bumblebeed.

Here is a screenshot of my drivers:

If anyone can help me, please respond as I have looked everywhere for a solution but nobody seems to have the same issue as me. Thanks!

prime-run command is installed if you have installed the prime drivers called video-hybrid-intel-nvidia-prime driver,this driver can only be installed if you have a laptop,you have a laptop?,it would be weird if its a laptop and that driver is not showing to you.

1 Like

No, this is all on a desktop. Yet, I still have the prime-run command even though I do not have those drivers as you said.

Thats weird,but if its a desktop you may want the video-nvidia driver instead,the 390 is a old driver just for compatibility,you can click the button above that says “auto install proprietary drivers”.

Then when its ready,your gpu will be used all the time,no need for optimus manager nor prime-run command,everything will be rendering with your nvidia card.

Ok, will try that when I get home and update you on if it works or not.

video-nvidia conflicts with video-nvidia-390xx when I try to auto-install proprietary drivers. I just remembered that I originally had it, but tried switching to video-nvidia-390xx because video-nvidia was not working with bumblebee or optimus manager or any of that stuff.

EDIT: Should I use try using a different driver such as 440x or try going back to video-nvidia?

Bumblebee is also for laptops,you dont need it

Yeah uninstall video-nvidia-driver-390 then install just video-nvidia,i think you also need to uninstall video-linux since that is the open source driver but im not sure, do a backup just in case.

Then reboot when finish installing.

Hm, ok. How do I create a backup? And also, what is the video-linux driver for since you think I dont need it?

video-linux is the open source driver but is not official by NVIDIA and have poor performance so is not recommended.

Backup you can do it with timeshift program,it comes preinstalled with Manjaro

Ok, I did that, I now only have video-nvidia and it still does not work because moving a floating window uses high CPU usage and minecraft is still on 5 fps and does not say anything related to my nvidia gpu. Any other ideas or tests?

If you have still optimus manager installed you need to remove it,if you have already uninstalled then thats weird.
Also put in a terminal the command inxi -Fazy and give me the output.

I agree with @XRaTiX. If this is a PC, you don’t need optimus-manager, bublebee or any hybrid technology that makes life harder. Oh wait, I just noticed your GPU is a mobole version… That is confusing. Is it really a stationary computer? Something is not right. No wonder if MHWD auto-installed hybrid technology.

It looks like you have GTX 1050, a fairly new card, so what are you doing with antiquated xx390 driver? Is it even compatible with your card? I suspect it may not be.

We’re waiting for this inxi output to see more.

Okay, glad another penguin has arrived to help! I uninstalled optimus-manager (and optimus-manager-qt) and then rebooted. Minecraft still runs very badly, and says nothing about my gpu. Supertuxkart also does, and it should not considering I have a fairly decent GPU. the command primusrun still is there, should I do something about that? Not sure if its a part of bumblebee or something else.

Also, here is the inxi -Fazy output:

  Kernel: 5.10.36-2-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.10-x86_64 
  root=UUID=4116a9d7-b857-42a8-9207-87b3ce4ed75f rw quiet apparmor=1 
  security=apparmor udev.log_priority=3 
  Desktop: i3 4.19.1 info: i3bar vt: 7 dm: LightDM 1.30.0 
  Distro: Manjaro Linux base: Arch Linux 
  Type: Desktop System: LENOVO product: 3302F2U v: ThinkCentre M82 
  serial: <filter> 
  Mobo: LENOVO model: MAHOBAY v: Win8 Pro DPK TPG serial: <filter> 
  BIOS: LENOVO v: 9SKT61AUS date: 02/27/2013 
  Info: Quad Core model: Intel Core i5-3470 bits: 64 type: MCP 
  arch: Ivy Bridge family: 6 model-id: 3A (58) stepping: 9 microcode: 21 
  cache: L2: 6 MiB 
  flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 bogomips: 25555 
  Speed: 1597 MHz min/max: 1600/3600 MHz Core speeds (MHz): 1: 1597 2: 1681 
  3: 1739 4: 1598 
  Vulnerabilities: Type: itlb_multihit status: KVM: VMX unsupported 
  Type: l1tf mitigation: PTE Inversion 
  Type: mds mitigation: Clear CPU buffers; SMT disabled 
  Type: meltdown mitigation: PTI 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: disabled, RSB filling 
  Type: srbds status: Vulnerable: No microcode 
  Type: tsx_async_abort status: Not affected 
  Device-1: NVIDIA GP107 [GeForce GTX 1050] vendor: driver: nvidia 
  v: 460.80 alternate: nouveau,nvidia_drm bus-ID: 01:00.0 chip-ID: 10de:1c81 
  class-ID: 0300 
  Display: x11 server: X.Org 1.20.11 compositor: picom v: git-dac85 driver: 
  loaded: nvidia note: n/a (using device driver) failed: nvidia display-ID: :0 
  screens: 1 
  Screen-1: 0 s-res: 1920x1080 s-dpi: 93 s-size: 524x292mm (20.6x11.5") 
  s-diag: 600mm (23.6") 
  Monitor-1: HDMI-0 res: 1920x1080 hz: 60 dpi: 94 size: 521x293mm (20.5x11.5") 
  diag: 598mm (23.5") 
  OpenGL: renderer: llvmpipe (LLVM 11.1.0 256 bits) v: 4.5 Mesa 21.0.3 
  compat-v: 3.1 direct render: Yes 
  Device-1: Intel 7 Series/C216 Family High Definition Audio vendor: Lenovo 
  driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:1e20 
  class-ID: 0403 
  Device-2: NVIDIA GP107GL High Definition Audio vendor: 
  driver: snd_hda_intel v: kernel bus-ID: 01:00.1 chip-ID: 10de:0fb9 
  class-ID: 0403 
  Device-3: C-Media Blue Snowball type: USB 
  driver: hid-generic,snd-usb-audio,usbhid bus-ID: 1-1.1:3 chip-ID: 0d8c:0005 
  class-ID: 0300 serial: <filter> 
  Sound Server-1: ALSA v: k5.10.36-2-MANJARO running: yes 
  Sound Server-2: JACK v: 0.125.0 running: no 
  Sound Server-3: PulseAudio v: 14.2 running: no 
  Device-1: Intel 82579LM Gigabit Network vendor: Lenovo driver: e1000e 
  v: kernel port: f040 bus-ID: 00:19.0 chip-ID: 8086:1502 class-ID: 0200 
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter> 
  Local Storage: total: 465.76 GiB used: 46.13 GiB (9.9%) 
  SMART Message: Required tool smartctl not installed. Check --recommends 
  ID-1: /dev/sda maj-min: 8:0 vendor: Seagate model: ST500DM002-1BD142 
  size: 465.76 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s 
  rotation: 7200 rpm serial: <filter> rev: KC65 scheme: MBR 
  ID-1: / raw-size: 465.76 GiB size: 457.38 GiB (98.20%) 
  used: 46.13 GiB (10.1%) fs: ext4 dev: /dev/sda1 maj-min: 8:1 
  Alert: No swap data was found. 
  System Temperatures: cpu: 29.8 C mobo: 27.8 C gpu: nvidia temp: 29 C 
  Fan Speeds (RPM): N/A gpu: nvidia fan: 30% 
  Processes: 161 Uptime: 6m wakeups: 0 Memory: 7.7 GiB used: 1.02 GiB (13.3%) 
  Init: systemd v: 247 tool: systemctl Compilers: gcc: 10.2.0 clang: 11.1.0 
  Packages: apt: 0 pacman: 1424 lib: 303 Shell: Zsh v: 5.8 default: Bash 
  v: 5.1.8 running-in: xfce4-terminal inxi: 3.3.04 

Also, here is my drivers:

That’s PC, all right. So probably Lenovo cheated a bit by using a weaker, mobile model, but it’s still powerful enough to run most of modern games. My Nvidia card is much older, and I was still able to play Cyberpunk 2077, so your GPU is fairly capable.

With video-nvidia mhwd setup, you will get the latest Nvidia drivers, which is correct for your hardware, so there was no need for optimus-manager, bumblebee, hybrid setup or prime-run, optirun, primusrun or any of that. Those only work when the main iGPU is usually Intel and there is a secondary dGPU. In your case there is only one GPU, a dedicated one, so it should work out of the box if the right drivers are installed and configured properly, so no additional commands should be needed.

Unfortunately, I don’t see any obvious reason why Nvidia is malfunctioning, but since the driver is there, I assume the problem is in config.

I would check Nvidia settings first. If this doesn’t help, Green with Envy can manage Nvidia in more details, but it would be weird if you needed this to make your GPU work properly. This has to be some basic configuration flaw.

You may also check out this arch wiki article (ignore install part, this one is not for Manjaro):

What exactly you mean by this? Minecraft has an internal benchmark or something?

Here says your nvidia drivers is installed correctly,so maybe is another issue?
I can give you an idea,try disabling the compositor,I don’t know if even i3 has one but i think it have,disable that and then execute the game,if you are using Lutris you go to the game options then in the system options tab the option turn off desktop effects

Another thing I found is this in the Arch wiki about lag with the nvidia propietary drivers,you can try that too

I have tried nvidia-xconfig, and had no affect even after running it with lutris and enabling disable desktop effects which didn’t help either.

In minecraft, upon pressing F3, a hardware and other information screen is brought up.
In the right section of this screenshot, you can see it mentions my processor. However, below that, it should mention something about Nvidia or GTX 1050 since that is what it would always do back when I used to use windows. Not sure if llvmpipe/mesa has anything to do with this issue, but I saw something related to it in the GPU section of inxy -Fazy, I think. Any other ideas, or is there a connection between llvmpipe/mesa and my GPU/CPU?

Should I install nvidia-prime to use prime-run and see if that does anything? Would it hurt anything to do so?

Also, inxi -Gazy outputs:

Not sure if the fact that it says failed: nvidia is relevant to the problem or not.

Now that you mention it,you are right,looks like it using llvmpipe for some reason instead of nvidia and thats the main problem,I look in google and looks like some people had that problem,there is even a solution

So looks like you need to add this to your /etc/X11/xorg.conf

Section "Files"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"

Try that and reboot to see if its works.

That will not do anything because thats for laptop with 2 video cards,you need a Intel/AMD iGPU and a NVIDIA gpu to make it work.

1 Like

You don’t need it. It shouldn’t have any effect. The problem appears to be that the llvmpipe renderer is used (which is a software renderer).

Can you recover the latest Xorg log from /var/log/ or ~/.local/share/xorg/?

1 Like

After following that suggestion and adding it to my config file and rebooting, it worked! My confidence in my desktop and manjaro restored. However, the funny thing is that I actually did that exact solution a few minutes ago, just forgot to reboot like a rookie and thought it didn’t work. Lol, thanks for the help everyone, couldn’t have done it without you guys!