[HowTo] Getting NVIDIA Geforce GT740m working on Manjaro with mhwd and Bumblebee390xx

Intro

This tutorial describes the process of getting Nvidia-Bumblebee working on Manjaro through mhwd and manual interventions.

I’m not sure which manual interventions were necessary or not. I’m still not an expert in regard to GPU config. Rather, I just share my trajectory that works.

When you take the MHWD-Bumblebee route, you should not install or have installed NVIDIA-Linux-x86_64-390.157 manually.
If you have, uninstall it with command ./NVIDIA-Linux-x86_64-390.157.run --uninstall and reboot.

Take a Timeshift snapshot

If you start messing around with the GPU without taking a snapshot first, you are clinically insane.

Take a Timeshift snapshot.

Hard reinstall of Bumblebee 390xx proprietary

Remove CUDA.

sudo pacman -Rdd cuda

Remove all nvidia-dkms related stuff with the package manager or pacman.

Run a force install command for proprietary Nvidia drivers.

sudo mhwd -f --auto pci nonfree 0300

I got errors certain files already existed, so I removed them all to be sure the command would finish completely and successfully.

sudo rm -rf /usr/lib32/libEGL_nvidia.so.0 
sudo rm -rf /usr/lib32/libGLESv1_CM_nvidia.so.1
sudo rm -rf /usr/lib32/libGLESv2_nvidia.so.2
sudo rm -rf /usr/lib32/libGLX_nvidia.so.0
sudo rm -rf /usr/lib32/libcuda.so.1
sudo rm -rf /usr/lib32/libnvcuvid.so.1
sudo rm -rf /usr/lib32/libnvidia-eglcore.so.390.157
sudo rm -rf /usr/lib32/libnvidia-encode.so.1
sudo rm -rf /usr/lib32/libnvidia-fatbinaryloader.so.390.157
sudo rm -rf /usr/lib32/libnvidia-fbc.so.1
sudo rm -rf /usr/lib32/libnvidia-glcore.so.390.157
sudo rm -rf /usr/lib32/libnvidia-glsi.so.390.157
sudo rm -rf /usr/lib32/libnvidia-ifr.so.1
sudo rm -rf /usr/lib32/libnvidia-ml.so.1
sudo rm -rf /usr/lib32/libnvidia-ptxjitcompiler.so.1
sudo rm -rf /usr/lib32/libnvidia-tls.so.390.157

Run the command again.

sudo mhwd -f --auto pci nonfree 0300

Remove ‘video-linux’

sudo mhwd --remove pci video-linux

If things aren’t working out, you can try this hard brush too, but normally, you can skip this one.

sudo pacman -Rcns bumblebee

Add your user to the bumblebee group

sudo usermod -a -G bumblebee $USER

Modify /etc/modprobe.d/mhwd-nvidia.conf

I only added alias drm off to my /etc/modprobe.d/mhwd-nvidia.conf, based on, and credits to, this post.

How my /etc/modprobe.d/mhwd-nvidia.conf looks:

##
## Generated by mhwd - Manjaro Hardware Detection
##
 
blacklist nouveau
blacklist nvidia
blacklist nvidia-modeset
blacklist nvidia-uvm
blacklist ttm
blacklist drm_kms_helper
blacklist drm
alias drm off

Optional, if you want to work further with the points that post raises,
be my guest, however, all following points I did not do because they didn’t seem relevant to my case.

Points I did NOT incorporate from the post.

  • __GLVND_DISALLOW_PATCHING=1
  • change LibraryPath
  • disable gpu manager
  • nvidia-persistenced

Get the Nvidia BusID

lspci -k | grep -A 2 -E "(VGA|3D)"

Output:

01:00.0 3D controller: NVIDIA Corporation GK208M [GeForce GT 740M] (rev a1)
	Subsystem: CLEVO/KAPOK Computer GK208M [GeForce GT 740M]
	Kernel driver in use: nvidia

The 01:00.0 is the BusID in my case, yours could be different, you should use yours.

Add your Nvidia BusID to /etc/bumblebee/xorg.conf.nvidia

sudo nano /etc/bumblebee/xorg.conf.nvidia

Add your BusID to Section "Device", here is how mine looks.
Important: in the section the value is PCI:1:00.0 and not PCI:01:00.0 as seen in the lspci output.

Section "Device"
    Identifier  "Device1"
    Driver      "nvidia"
    VendorName "NVIDIA Corporation"
    Option "NoLogo" "true"
    Option "UseEDID" "false"
    Option "ConnectedMonitor" "DFP"
    BusID "PCI:1:0:0"
EndSection

Ignore ABI in /etc/bumblebee/xorg.conf.nvidia

About this one I’m not sure if it’s necessary.

I think it disables a component that involves CUDA, and that ABI stands for Application Binary Interface as stated in this document.

sudo nano /etc/bumblebee/xorg.conf.nvidia

Append this section at the bottom.

Section "ServerFlags"
  Option "ignoreABI" "true"
EndSection

Or:

echo -e '\nSection "ServerFlags"\n Option "ignoreABI" "true"\nEndSection' | sudo tee -a /etc/bumblebee/xorg.conf.nvidia

Disable Indirect Branch Tracking in GRUB

sudo nano /etc/default/grub

Add ibt=off to the value of GRUB_CMDLINE_LINUX_DEFAULT,
that line in my /etc/default/grub looks like so:

GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet ibt=off"

You need to update your GRUB to incorporate the change we just made.

update-grub

Reboot and check it works

Check if bumblebee is running without errors.

systemctl status bumblebeed

If bumblebeed can’t start without errors, you’ll have to troubleshoot it further.
In that case, start bumblebeed manually in the terminal with /usr/bin/bumblebeed.
Once you made changes, restart bumblebeed with sudo systemctl restart bumblebeed.

Options to check Nvidia is running

  1. optirun -vv glxheads

    When I run it, I see a green triangle rotating, and more importantly, the output below confirms Nvidia is in use, see GL_RENDERER.
    The -vv argument in the command enables useful debugging information too.

     glxheads: exercise multiple GLX connections (any key = exit)
     Usage:
     glxheads xdisplayname ...
     Example:
     glxheads :0 mars:0 venus:1
     Name: :0
     Display:     0x55633e3cecf0
     Window:      0x3000002
     Context:     0x55633e3e9138
     GL_VERSION:  4.6.0 NVIDIA 390.157
     GL_VENDOR:   NVIDIA Corporation
     GL_RENDERER: GeForce GT 740M/PCIe/SSE
    
  2. Open nvidia-settings.

    optirun -vv nvidia-settings -c :8

    I can’t start nvidia-settings from the Gnome launcher, however the above command works.

  3. lspci -k | grep -A 2 -E "(VGA|3D)"

    It should look like this:

     01:00.0 3D controller: NVIDIA Corporation GK208M [GeForce GT 740M] (rev a1)
     Subsystem: CLEVO/KAPOK Computer GK208M [GeForce GT 740M]
     Kernel driver in use: nvidia
    

Final words

So CUDA does not work now. It could turn out to be quite easy to get it working, like just install it from package manager. That said, I’ve had enough now and am just going to be happy with this result for the time being.

Hopefully, this tutorial spares you my struggles.
Hopefully, this tutorial doesn’t mess up your system.
I did tell you to take a Timeshift snapshot though.

Greets.

1 Like

Welcome to the forum! :wave:

Please see the following:

And triple check your wording.
Extra important if you create a tutorial.

Thanks for correcting that bedna <3

1 Like

There were a bunch of spelling errors haha, but I corrected them soon after the post.