Difficulty installing drivers for a hybrid system (CPU and GPU)

I am using a laptop with 2 GPUs (iGPU and dGPU), and I am quite unsure on how to install graphics drivers. I was told to do “sudo pacman -S nvidia” in the terminal, to which I did. But it seems there is a missing piece. Any help would be appreciated. There is an inxi -G output, and a prime-run glxgears output, to hopefully help.


GLXGEARS

X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 26
Current serial number in output stream: 27

INXI

Device-1: Intel CometLake-H GT2 [UHD Graphics] driver: i915 v: kernel
Device-2: NVIDIA TU117M [GeForce GTX 1650 Ti Mobile] driver: N/A
Device-3: Chicony HD User Facing type: USB driver: uvcvideo
Display: x11 server: X.Org v: 21.1.3 driver: X: loaded: intel
unloaded: fbdev,modesetting,vesa gpu: i915 resolution: 1920x1080~144Hz
OpenGL: renderer: Mesa Intel UHD Graphics (CML GT2) v: 4.6 Mesa 22.0.1

There are multiple ways as outlined here: NVIDIA Optimus - ArchWiki. Better support can be offered on our Discord server if you have trouble following the Wiki.

The simplest method is to install the nvidia package and the bumblebee package. Although this apparently has performance issues.

I personally use optimus-manager. It has special steps for Gnome and GDM users: GitHub - Askannz/optimus-manager: A Linux program to handle GPU switching on Optimus laptops.

sudo pacman -S --needed nvidia optimus-manager
sudo systemctl enable --now optimus-manager.service

@LydeXD

Updated to include commands

Solved on Discord. Installed nvidia-lts for the LTS kernel along with optimus-manager.