How to change from dropped legacy nvidia to nouveau?

How do I switch from the nvidia driver to nouveau?
I think the usual way is simply to use Manjaro Hardware Configuration:

  1. auto install open-source driver
  2. Uninstall nvidia driver
    Example: Cannot switch to nouveau - #5 by Paradox

But the nvidia driver doesn’t appear in this list, so how do I remove it manually?

More info:

$ mhwd -li
> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
         network-r8168            2016.04.20                true            PCI
           video-linux            2018.05.04                true            PCI

$ inxi -G
Graphics:  Device-1: NVIDIA G92 [GeForce 9800 GT] driver: nvidia v: 340.108 
           Display: x11 server: X.Org 1.20.10 driver: nvidia resolution: 1920x1080~60Hz 
           OpenGL: renderer: GeForce 9800 GT/PCIe/SSE2 v: 3.3.0 NVIDIA 340.108 

$ uname -a
Linux manjaro-desktop 5.4.85-1-MANJARO #1 SMP PREEMPT Mon Dec 21 21:38:53 UTC 2020 x86_64 GNU/Linux

I had to uninstall it via “pamac”. As you already have “nouveau” (video-linux 2018.05.04 true PCI) installed, all that remains is to look for the nvidia packages installed on your system:

pamac list -i | grep nvidia

I don’t remember if I had to uninstall all the packages or just the driver package, which in your case would be “340xx”.

See if a colleague can confirm this.

I tried exactly that (from a non-booting sys) and totally messed up (left over nvidia.confs or blacklists picked up by xorg?) Ultimately, I turned around and followed the pinned post to build and re-install the nvidia-340xx driver, which worked.

Spend about 3 days trying going nouveau and 30min building and installing nvidia. Also, keep in mind that having problems with nvidia legacy drivers is at the mo a bit of a ‘meh’ issue around here. How do I know… :grin:

Edited: That grep should show a list; I removed lib32, utils and the driver and only left the ‘mhwd’ pkgs. But, as I said, I messed up royally.

I had to uninstall it via “pamac”

After installing nouveau, I removed the nvidia packages using pacman, which resulted in unbootable system because Manjaro was still trying to use nvidia drivers even though the packages were no longer present.
My understanding is that the “magic” to switch over from nvidia to nouveau is handled by mhwd, but as I said I can’t do this since mhwd no longer recognizes the dropped legacy packages.

So, are you saying that pamac handles it differently than pacman, and so all I have to do is use pamac instead?

Ultimately, I turned around and followed the pinned post to build and re-install the nvidia-340xx driver, which worked

Thank you, my first choice is not to do this as it is really just kicking the can down the road.

There must be a way to execute the mhwd uninstall and driver switching manually, I think it is important & reasonable to have this information.
@philm Can you please teach us how (or direct me to the appropriate person)?

What I did was to remove the nvidia packages of an unsupported version with pamac and install video-nvidia (which are the latest ones) with mhwd. I certainly didn’t use nouveau at any time. So I can’t confirm that it will work.

MHWD said it only had nouveau installed, but inxi said it used nvidia.

Thank you.
I know nouveau will work, live usb works and I have run it in the past.

Just need to know how to properly switch drivers (without using mhwd)

When using an nVidia driver, nouveau is blacklisted to prevent it from loading.

I think if you remove the nvidia packages using pamac and unblacklist nouveau, it should work.

sudo nano /etc/modprobe.d/mhwd-gpu.conf

This is the content of mine:

Generated by mhwd - Manjaro Hardware Detection

blacklist nouveau
blacklist ttm
blacklist drm_kms_helper
blacklist drm

I also had to clean out nvidia.conf files (try renaming!) in /etc/X11 and /etc/X11/xorg.conf.d/ and /etc/X11/mhwd.d plus I found further nvidia files at my root. I believe some are created by the nvidia-settings tool. Also check your xorg.conf.

However, and I think that’s where I messed up, not all files that have ‘nvidia’ either in the name or contain ‘nvidia’ references (blacklists) can or have to be deleted or those references edited because the free driver has to deal with nvidia hardware too so some might possibly be needed by that.
Anyway, good luck.

Thank you, I tried commenting out the “blacklist nouveau” line but still booted running nvidia.
Also tried updating grub and reboot but still nvidia.

Do you think I need to actually uninstall?
Hesitant to uninstall because of the pain in recovery to get bootable system back (boot into live USB and shuffle snapshots), so just want to get some confidence it will work.

Yeah, this is my concern, I think that some of the files that look like nonfree driver are also used by free.
Would really like some clarification on what the “automatic” mhwd steps are so I can just do the same thing manually.

The 3 nvidia driver packages? Yes, you have to do that first, I thought you did this already:

I removed the nvidia packages using pacman, which resulted in unbootable system

That unbootable system is most likely caused by nvidia dropping conf files when using the nvidia settings app. Those are then still getting picked up by the starting Xserver; the result is ‘no screens found’ error. Better read up on those, I mentioned the relevant locations above.
And yes, I would think you’ll have to do this ‘clean up’ from the console after the nvidia pkgs are gone.

Remember, ! gave up on that, so I might not be the best guy to listen to here…

However, try, I even reinstalled xorg. If it fails it’s (then relatively) easy to turn around, just follow the pinned post to install the nvidia-340xx-dkms driver.

Good luck!

I have been digging into various scripts, not my forte so it is tedious and arduous.

So it looks like all I have to do is remove the nonfree stuff, denylisting, etc, and then nouveau will “just work”, is that correct?
(because I already have video-linux installed, via auto install of open-source driver)

I haven’t yet found the uninstall magic, so might need to just make a list of what the installers do and work backwards. Best bet looks to be the post_remove() function in pci/graphic_drivers/nvidia/MHWDCONFIG · master · Applications / mhwd-db · GitLab (needs more followup)

Notes about files to look into from rummaging around gitlab:

/etc/X11/mhwd.d/nvidia.conf
/etc/modprobe.d/mhwd-gpu.conf
/etc/modules-load.d/mhwd-gpu.conf
/etc/mhwd-x86_64.conf
/etc/X11/xorg.conf.d/90-mhwd.conf

To do:

  • Check files
  • More review of scripts
  • Look into modset
  • Look xorg config
  • Make list of packages
  • Look for older gitlab (from before dropped) to see if exceptions for 340 drivers

Sources:

Figured it out.
I might have uninstalled more packages than necessary (had warnings about optional dependencies), but it definitely worked.

# List the nvidia packages
$ pamac list -i | grep nvidia
lib32-nvidia-340xx-utils           340.108-1                              109.1 MB
linux419-nvidia-340xx              340.108-71                             4.9 MB
linux54-nvidia-340xx               340.108-80                             4.9 MB
mhwd-nvidia                        455.45.01-3                 core       1.5 kB
mhwd-nvidia-340xx                  340.108-1                              2.5 kB
mhwd-nvidia-390xx                  390.138-1                   core       1.9 kB
nvidia-340xx-utils                 340.108-1                              139.3 MB
opencl-nvidia-340xx                340.108-1                              39.3 MB

# Remove nvidia 340 driver packages
sudo pacman -Rs linux419-nvidia-340xx linux54-nvidia-340xx mhwd-nvidia-340xx lib32-nvidia-340xx-utils nvidia-340xx-utils opencl-nvidia-340xx

# Elevate privileges
sudo su

# Remove mhwd's nvidia xorg config
rm /etc/X11/mhwd.d/nvidia.conf

# Remove denylist entries for nouveau
sed -i '/^blacklist nouveau/d' "/etc/modprobe.d/mhwd-gpu.conf"
sed -i '/^blacklist ttm/d' "/etc/modprobe.d/mhwd-gpu.conf"
sed -i '/^blacklist drm_kms_helper/d' "/etc/modprobe.d/mhwd-gpu.conf"
sed -i '/^blacklist drm/d' "/etc/modprobe.d/mhwd-gpu.conf"

# Remove allowlist entry for nvidia
sed -i '/^nvidia/d' "/etc/modules-load.d/mhwd-gpu.conf"

# Remove xorg's link to mhwd's nvidia xorg config
mhwd-gpu --check

# Un-elevate privileges
exit

# Reboot
reboot

# Check driver
$ inxi -G
Graphics:  Device-1: NVIDIA G92 [GeForce 9800 GT] driver: nouveau v: kernel 
           Display: x11 server: X.Org 1.20.10 driver: nouveau unloaded: modesetting resolution: 1920x1080~60Hz 
           OpenGL: renderer: NV92 v: 3.3 Mesa 20.3.1
2 Likes

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