NVidia Optimus - I can no longer use my graphics card with Wine for some applications

The solution was to remove some old components/drivers and (re)install updated versions. The answer below is an adaptation of my answer to a problem related also to NVidia Optimus graphics ( NVidia Optimus - Graphics card no longer can be activated by the primusrun command (bumblebee) ).

IMPORTANT:

Handling video card drivers is always a critical process and YOU RISK RUNNING OUT OF ACCESS TO THE MANJARO’S GRAPHICAL USER INTERFACE. So, first of all WE STRONGLY RECOMMEND burning a DVD or preparing a USB stick with the Manjaro’s installer ISO ( Manjaro - Downloads ). If something goes wrong you can access your Manjaro’s installation by booting your computer with the Manjaro’s installer and then run the manjaro-chroot -a command on the terminal.

To writing a Manjaro installer ISO to a USB stick you could use the dd bs=4M if=<PATH_TO_MANJARO_ISO> of=/dev/sd<DRIVE_LETTER> status=progress oflag=sync command. Use the fdisk -l command to find out the <DRIVE_LETTER>. To burn to a DVD you could use the K3b application ( K3b ).

[Refs.: Burn an ISO File - Manjaro , Manjaro Brasil • Exibir tópico - Atualização no Mabox quebra o x ]

INSTALL NVIDIA PRIME:

Find out the exact driver name you use now with the command…

mhwd -li

… and, if applicable, remove with this example command…

mhwd -f -i pci <DRIVER_NAME>

If applicable, remove these other components…

yay -Rc optimus-manager
yay -Rc linux54-nvidia-440xx
yay -Rc nvidia-440xx-utils

(Re)Install new Nvidia prime driver…

mhwd -f -i pci video-modesetting
mhwd -f -i pci video-hybrid-intel-nvidia-prime

Create the 10-prime-offload.conf Xorg configuration file with this command…

read -r -d '' FILE_CONTENT << 'HEREDOC'
BEGIN
Section "ServerLayout"
    Identifier "layout"
    Screen 0 "intel"
    Inactive "nvidia"
    Option "AllowNVIDIAGPUScreens"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
EndSection

END
HEREDOC
echo -n "${FILE_CONTENT:6:-3}" > '/etc/X11/xorg.conf.d/10-prime-offload.conf'

TIP: Use the lspci | grep -E "VGA|3D" command to confirm the BusID of each device.

Run the command…

systemctl set-default multi-user.target

… and reboot your computer.

IMPORTANT: The systemctl set-default multi-user.target command will cause your graphical user interface to be temporarily unusable. Therefore, access this thread via another device (a smart phone, for example) as the next commands must be executed manually after reboot and login.

modprobe nvidia
modprobe nvidia_modeset
modprobe nvidia_drm
systemctl set-default graphical.target
reboot

Done! =D

[Refs.: https://www.reddit.com/r/linux_gaming/comments/itx2bw/help_i_think_i_messed_up_my_nvidia_drivers/ , NVidia Optimus - Graphics card no longer can be activated by the primusrun command (bumblebee) , How to Use Manjaro Hardware Detection Tool – Linux Hint ]