try to install mhwd prime-offloading on nvidia 820M

[fla@fla-pc ~]$ sudo set-nvidia.sh
[sudo] password for fla: 
Removing intel only mode setup......
Setting nvidia prime mode.......
Done! After reboot you will be using nvidia prime mode.
[fla@fla-pc ~]$ inxi -Fxxxza
System:    Host: fla-pc Kernel: 5.5.0-1-MANJARO x86_64 bits: 64 compiler: gcc v: 9.2.0 
           parameters: BOOT_IMAGE=/boot/vmlinuz-5.5-x86_64 root=UUID=a1620fc4-9319-41f5-87fd-7e36032641a7 rw quiet apparmor=1 
           security=apparmor udev.log_priority=3 
           Desktop: KDE Plasma 5.17.5 tk: Qt 5.14.0 wm: kwin_x11 dm: SDDM Distro: Manjaro Linux 
Machine:   Type: Laptop System: Micro-Star product: CX61 2PC v: REV:1.0 serial: <filter> Chassis: CX61 2PC type: 10 
           serial: <filter> 
           Mobo: Micro-Star model: MS-16GD v: REV:1.0 serial: <filter> BIOS: American Megatrends v: E16GDIMS.50N 
           date: 03/25/2014 
CPU:       Topology: Dual Core model: Intel Core i5-4210M bits: 64 type: MT MCP arch: Haswell family: 6 model-id: 3C (60) 
           stepping: 3 microcode: 27 L2 cache: 3072 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 20762 
           Speed: 898 MHz min/max: 800/3200 MHz Core speeds (MHz): 1: 898 2: 898 3: 898 4: 901 
           Vulnerabilities: Type: itlb_multihit status: KVM: Split huge pages 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
           Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
           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: conditional, RSB filling 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: Micro-Star MSI driver: i915 v: kernel 
           bus ID: 00:02.0 chip ID: 8086:0416 
           Device-2: NVIDIA GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M] driver: N/A bus ID: 01:00.0 
           chip ID: 10de:1140 
           Display: x11 server: X.Org 1.20.7 driver: intel compositor: kwin_x11 resolution: 1366x768~60Hz 
           OpenGL: renderer: Mesa DRI Intel Haswell Mobile v: 4.5 Mesa 19.3.2 compat-v: 3.0 direct render: Yes 
Audio:     Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio vendor: Micro-Star MSI driver: snd_hda_intel 
           v: kernel bus ID: 00:03.0 chip ID: 8086:0c0c 
           Device-2: Intel 8 Series/C220 Series High Definition Audio vendor: Micro-Star MSI driver: snd_hda_intel v: kernel 
           bus ID: 00:1b.0 chip ID: 8086:8c20 
           Sound Server: ALSA v: k5.5.0-1-MANJARO 
Network:   Device-1: Qualcomm Atheros AR8161 Gigabit Ethernet vendor: Micro-Star MSI driver: alx v: kernel port: d000 
           bus ID: 04:00.0 chip ID: 1969:1091 
           IF: enp4s0 state: up speed: 100 Mbps duplex: full mac: <filter> 
           Device-2: Realtek RTL8723AE PCIe Wireless Network Adapter vendor: AzureWave driver: rtl8723ae v: kernel port: c000 
           bus ID: 05:00.0 chip ID: 10ec:8723 
           IF: wlp5s0 state: down mac: <filter> 
           IF-ID-1: ppp0 state: unknown speed: N/A duplex: N/A mac: N/A 
Drives:    Local Storage: total: 1.02 TiB used: 34.99 GiB (3.4%) 
           ID-1: /dev/sda vendor: Toshiba model: HDWL110 size: 931.51 GiB block size: physical: 4096 B logical: 512 B 
           speed: 3.0 Gb/s rotation: 5400 rpm serial: <filter> rev: 0A temp: 27 C scheme: MBR 
           ID-2: /dev/sdb vendor: A-Data model: SU650 size: 111.79 GiB block size: physical: 512 B logical: 512 B 
           speed: 6.0 Gb/s serial: <filter> rev: 7A0 temp: 40 C scheme: MBR 
Partition: ID-1: / raw size: 30.00 GiB size: 29.40 GiB (98.01%) used: 8.95 GiB (30.4%) fs: ext4 dev: /dev/sdb1 
           ID-2: /home raw size: 81.79 GiB size: 80.00 GiB (97.82%) used: 26.04 GiB (32.6%) fs: ext4 dev: /dev/sdb2 
Sensors:   System Temperatures: cpu: 43.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 171 Uptime: 8m Memory: 7.70 GiB used: 1.21 GiB (15.7%) Init: systemd v: 242 Compilers: gcc: 9.2.0 
           clang: 9.0.1 Shell: bash v: 5.0.11 running in: konsole inxi: 3.0.37 
[fla@fla-pc ~]$ mhwd -li
> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
    video-nvidia-430xx            2019.10.25               false            PCI
           video-linux            2018.05.04                true            PCI


Warning: No installed USB configs!
[fla@fla-pc ~]$ ls -laR /etc/X11/ ; cat /etc/X11/xorg.conf.d/*.conf
/etc/X11/:
total 40
drwxr-xr-x  5 root root  4096 Jan 21 01:37 .
drwxr-xr-x 97 root root 12288 Feb  5 23:23 ..
drwxr-xr-x  2 root root  4096 Feb  5 22:52 mhwd.d
drwxr-xr-x  3 root root  4096 Jan 21 01:37 xinit
drwxr-xr-x  2 root root  4096 Feb  5 23:31 xorg.conf.d

/etc/X11/mhwd.d:
total 12
drwxr-xr-x 2 root root 4096 Feb  5 22:52 .
drwxr-xr-x 5 root root 4096 Jan 21 01:37 ..

/etc/X11/xinit:
total 28
drwxr-xr-x 3 root root 4096 Jan 21 01:37 .
drwxr-xr-x 5 root root 4096 Jan 21 01:37 ..
-rw-r--r-- 1 root root  739 Mar  4  2019 xinitrc
drwxr-xr-x 2 root root 4096 Jan 30 14:55 xinitrc.d
-rw-r--r-- 1 root root   45 Mar  4  2019 xserverrc

/etc/X11/xinit/xinitrc.d:
total 20
drwxr-xr-x 2 root root 4096 Jan 30 14:55 .
drwxr-xr-x 3 root root 4096 Jan 21 01:37 ..
-rwxr-xr-x 1 root root  318 Nov 10  2018 40-libcanberra-gtk-module.sh
-rwxr-xr-x 1 root root  203 Jan 23 01:46 50-systemd-user.sh

/etc/X11/xorg.conf.d:
total 24
drwxr-xr-x 2 root root 4096 Feb  5 23:31 .
drwxr-xr-x 5 root root 4096 Jan 21 01:37 ..
-rw-r--r-- 1 root root  266 Jan 21 06:24 00-keyboard.conf
-rw-r--r-- 1 root root  131 Jan 21 01:38 30-touchpad.conf
-rw-r--r-- 1 root root  483 Feb  5 23:31 99-nvidia.conf
# Read and parsed by systemd-localed. It's probably wise not to edit this file
# manually too freely.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us"
        Option "XkbModel" "pc105"
EndSection
Section "InputClass"
    Identifier "touchpad"
    Driver "libinput"
    MatchIsTouchpad "on"
    Option "Tapping" "on"
EndSection
#/etc/X11/xorg.conf.d/99-nvidia.conf
#adjust BusID to match your nvidia GPU
#uncomment and edit the DPI option as needed
#to fix scaling issues.


Section "Module"
    Load "modesetting"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver  "nvidia"
    BusID   "PCI:1:0:0"
    #Option  "DPI" "96 x 96"    #adjust this value as needed to fix scaling
    Option  "AllowEmptyInitialConfiguration"
EndSection

Section "Extensions"
    Option  "Composite" "Enable"
EndSection
[fla@fla-pc ~]$ 

this should of been uninstalled first as per the instructions.

sudo mhwd -r pci video-linux
sudo pacman -S xf86-video-intel 

sudo set-nvidia.sh

make sure there are mhwd/video conf files in these directories

/etc/modprobe.d/
/etc/modules-load.d/

then reboot

[fla@fla-pc ~]$ sudo mhwd -r video-linux
[sudo] password for fla: 
Error: invalid use of option: -r/--remove

Usage: mhwd [OPTIONS] <config(s)>

  --pci                                 list only pci devices and driver configs
  --usb                                 list only usb devices and driver configs
  -h/--help                             show help
  -v/--version                          show version of mhwd
  -f/--force                            force reinstallation
  -d/--detail                           show detailed info for -l/-li/-lh
  -l/--list                             list available configs for devices
  -la/--listall                         list all driver configs
  -li/--listinstalled                   list installed driver configs
  -lh/--listhardware                    list hardware information
  -i/--install <usb/pci> <config(s)>    install driver config(s)
  -ic/--installcustom <usb/pci> <path>  install custom config(s)
  -r/--remove <usb/pci> <config(s)>     remove driver config(s)
  -a/--auto <usb/pci> <free/nonfree> <classid>  auto install configs for classid
  --pmcachedir <path>                   set package manager cache path
  --pmconfig <path>                     set package manager config
  --pmroot <path>                       set package manager root

[fla@fla-pc ~]$ sudo mhwd -f -r video-linux
Error: invalid use of option: -r/--remove

Usage: mhwd [OPTIONS] <config(s)>

  --pci                                 list only pci devices and driver configs
  --usb                                 list only usb devices and driver configs
  -h/--help                             show help
  -v/--version                          show version of mhwd
  -f/--force                            force reinstallation
  -d/--detail                           show detailed info for -l/-li/-lh
  -l/--list                             list available configs for devices
  -la/--listall                         list all driver configs
  -li/--listinstalled                   list installed driver configs
  -lh/--listhardware                    list hardware information
  -i/--install <usb/pci> <config(s)>    install driver config(s)
  -ic/--installcustom <usb/pci> <path>  install custom config(s)
  -r/--remove <usb/pci> <config(s)>     remove driver config(s)
  -a/--auto <usb/pci> <free/nonfree> <classid>  auto install configs for classid
  --pmcachedir <path>                   set package manager cache path
  --pmconfig <path>                     set package manager config
  --pmroot <path>                       set package manager root

[fla@fla-pc ~]$

oops
sudo mhwd -r pci video-linux

[fla@fla-pc ~]$ sudo mhwd -r pci video-linux
> Removing video-linux...
Sourcing /etc/mhwd-x86_64.conf
Has lib32 support: true                                                                                                                                                                         
Sourcing /var/lib/mhwd/local/pci/video-linux/MHWDCONFIG                                                                                                                                         
Processing classid: 0300                                                                                                                                                                        
Sourcing /var/lib/mhwd/scripts/include/0300                                                                                                                                                     
Processing classid: 0380                                                                                                                                                                        
Processing classid: 0302                                                                                                                                                                        
checking dependencies...                                                                                                                                                                        
:: lib32-libva optionally requires lib32-libva-vdpau-driver: vdpau back-end for nvidia                                                                                                          
:: lib32-mesa optionally requires lib32-mesa-vdpau: for accelerated video playback                                                                                                              
:: libva optionally requires libva-vdpau-driver: backend for Nvidia and AMD GPUs                                                                                                                
:: mesa optionally requires mesa-vdpau: for accelerated video playback                                                                                                                          
:: mesa optionally requires libva-mesa-driver: for accelerated video playback                                                                                                                   
:: vlc optionally requires libva-vdpau-driver: vdpau backend nvidia                                                                                                                             
:: vulkan-icd-loader optionally requires vulkan-driver: packaged vulkan driver                                                                                                                  

Packages (14) libxvmc-1.0.12-2  lib32-libva-vdpau-driver-0.7.4-6  lib32-mesa-vdpau-19.3.2-1  lib32-vulkan-intel-19.3.2-1  lib32-vulkan-radeon-19.3.2-1  libva-mesa-driver-19.3.2-2  libva-vdpau-driver-0.7.4-4  mesa-vdpau-19.3.2-2  vulkan-intel-19.3.2-2  vulkan-radeon-19.3.2-2  xf86-video-amdgpu-19.1.0-1  xf86-video-ati-1:19.1.0-1  xf86-video-intel-1:2.99.917+899+gf66d3954-1  xf86-video-nouveau-1.0.16-1                                                                                                                                                                             

Total Removed Size:  57.40 MiB                                                                                                                                                                  

:: Do you want to remove these packages? [Y/n]                                                                                                                                                  
:: Processing package changes...                                                                                                                                                                
removing lib32-mesa-vdpau...                                                                                                                                                                    
removing lib32-libva-vdpau-driver...                                                                                                                                                            
removing lib32-vulkan-radeon...                                                                                                                                                                 
removing lib32-vulkan-intel...                                                                                                                                                                  
removing mesa-vdpau...                                                                                                                                                                          
removing libva-vdpau-driver...                                                                                                                                                                  
removing libva-mesa-driver...                                                                                                                                                                   
removing vulkan-radeon...                                                                                                                                                                       
removing vulkan-intel...                                                                                                                                                                        
removing xf86-video-nouveau...                                                                                                                                                                  
removing xf86-video-intel...                                                                                                                                                                    
removing libxvmc...                                                                                                                                                                             
removing xf86-video-amdgpu...                                                                                                                                                                   
removing xf86-video-ati...
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
> Successfully removed video-linux
[fla@fla-pc ~]$ sudo pacman -S xf86-video-intel
resolving dependencies...
looking for conflicting packages...

Packages (2) libxvmc-1.0.12-2  xf86-video-intel-1:2.99.917+899+gf66d3954-1

Total Download Size:   0.02 MiB
Total Installed Size:  2.29 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 libxvmc-1.0.12-2-x86_64                                                                 23.1 KiB  7.52 MiB/s 00:00 [#####################################################################] 100%
(2/2) checking keys in keyring                                                                                      [#####################################################################] 100%
(2/2) checking package integrity                                                                                    [#####################################################################] 100%
(2/2) loading package files                                                                                         [#####################################################################] 100%
(2/2) checking for file conflicts                                                                                   [#####################################################################] 100%
(2/2) checking available disk space                                                                                 [#####################################################################] 100%
:: Processing package changes...
(1/2) installing libxvmc                                                                                            [#####################################################################] 100%
(2/2) installing xf86-video-intel                                                                                   [#####################################################################] 100%
>>> This driver now uses DRI3 as the default Direct Rendering
    Infrastructure. You can try falling back to DRI2 if you run
    into trouble. To do so, save a file with the following 
    content as /etc/X11/xorg.conf.d/20-intel.conf :
      Section "Device"
        Identifier  "Intel Graphics"
        Driver      "intel"
        Option      "DRI" "2"             # DRI3 is now default 
        #Option      "AccelMethod"  "sna" # default
        #Option      "AccelMethod"  "uxa" # fallback
      EndSection
Optional dependencies for xf86-video-intel
    libxrandr: for intel-virtual-output [installed]
    libxinerama: for intel-virtual-output [installed]
    libxcursor: for intel-virtual-output [installed]
    libxtst: for intel-virtual-output [installed]
    libxss: for intel-virtual-output [installed]
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
[fla@fla-pc ~]$ 
[fla@fla-pc ~]$ ls -laR /etc/modprobe.d/ ; cat /etc/modprobe.d/99-nvidia.conf
/etc/modprobe.d/:
total 24
drwxr-xr-x  2 root root  4096 Feb  5 23:31 .
drwxr-xr-x 97 root root 12288 Feb  5 23:50 ..
-rw-r--r--  1 root root   150 Feb  5 23:52 99-nvidia.conf
#
#necessary blacklist and
#nvidia_drm modeset for nvidia/prime
#

blacklist nouveau
blacklist nvidiafb
blacklist rivafb
options nvidia_drm modeset=1
[fla@fla-pc ~]$ ls -laR /etc/modules-load.d/ ; cat /etc/modules-load.d/99-nvidia.conf
/etc/modules-load.d/:
total 28
drwxr-xr-x  2 root root  4096 Feb  5 23:31 .
drwxr-xr-x 97 root root 12288 Feb  5 23:50 ..
-rw-r--r--  1 root root    67 Feb  5 23:52 99-nvidia.conf
-rw-r--r--  1 root root    34 Nov 20 01:54 modules.conf
##
##loads necessary modules for nvidia gpu
##
 
nvidia
nvidia-drm
[fla@fla-pc ~]$ 

video-intel is the main, proprietary Intel driver, while modesetting is opensource driver for intel.

I personally use optimus-manager and set it to use:

Intel mode - modesetting (this is up to you, you can choose Intel as well, but modesetting allows for multi monitor setup for me, while Intel does not)
Hybrid mode - uses Intel modesetting (cannot be changed) but can allow Nvidia on demand by using special commands (those must be manually run or added to launch commands), however it doesn't allow currently for multi-monitors and is not as energy efficient as Intel session on older hardware
Nvidia mode - uses Nvidia proprietary drivers and is most energy hungry, but doesn't require any tinkering, everything graphical will use Nvidia.

See:

Also, if you want mode about power management options in optimus-manager for hybrid mode (Prime Offloading), read:

1 Like

doesn't work, black screen again.

What doesn't work? If you mean the optimus-switch, I can't help with that as I have no experience with it myself.

As I recall, optimus-manager didn't work for you from some unknown reason, so making optimus-switch work would be the best solution, although if I'm not mistaken, optimus-switch is not as flexible as optimus-manager.

hi :hugs:
maybe i should install 390 or 340 Nvidia drivers.

What doesn't work?

i mean optimus-switch nvidia mode

I'm confused. You wrote

but in the topic you said it's 820M which isn't fermi. If 440 drivers worked for you then it is not fermi and you shouldn't install any 390 or 340 drivers.

You did some risky, deep level changes to drivers manually. Since I didn't know optimus-switch and how it is set, I didn't follow what you have done. And if I had followed, I didn't know why you did those changes, because as I said, I don't understand what it has to do with optimus-switch.

Optimus-manager require from you now to have video-hybrid-intel-440-prime. When you install this, you will have a permanent Hybrid mode. If you want to be able to switch to Intel or Nvidia, you need to install and configure optimus-manager as described in my guide. Because the video-hybrid-intel-440-prime setup doesn't have bumblebee you ignore part where I say about disabling bumblebee, the rest stays the same.
I expanded the point 9 which discusses Hybird setup.

I'm not sure what was the issue in the past, maybe you can make optimus-manager work or maybe it will continue to not work for you. If you already taken steps to set optimus-switch, wait for the helpf of those who know how it works before you jump into different solution.

@dglt, can you make head or tails from this mess?

EDIT: @fla, I noticed, you didn't follow the instruction and didn't do this step, that @dglt told you :

sudo set-nvidia.sh

So if I understand it correctly, you stopped half-way, so no wonder you get black screen.

https://nvidia.custhelp.com/app/answers/detail/a_id/4656/~/list-of-fermi-series-geforce-gpus
· NVIDIA GeForce 820M

440 drivers

It doesn't work for me.
i remember when i installed ubuntu i saw just one nvidia option (340)
what's you mean? when i did this sudo set-nvidia.sh after reboot got black screen

Ah, you are right. In that case, you won't be able to use modern Hybrid mode (Prime Offloading) at all and you need to install video-hybrid-intel-390xx-nvidia-bumblebee and then switch from it to optimus-switch or optimus-manager. Possibly, stay on video-hybrid-intel-390xx-nvidia-bumblebee and use nvidia-xrun. And if you don't care about energy usage, you can set a permanent Nvidia PRIME setup.

So again, your reasonable options are:

why should i install bumblebee and not this method?

i mistakenly thought it was a GeForce GTX 820m but it's a GeForce 820M. nvidia.com says 430.xx works with either way but i do remember something a bout fermi cards not working on newer drivers. :man_shrugging:

run these

sudo mhwd -r pci video-nvidia-430xx
sudo mhwd -i pci video-nvidia-390xx
sudo rm /etc/X11/xorg.conf.d/90-mhwd.conf
sudo rm /etc/modprobe.d/mhwd-gpu.conf
sudo rm /etc/modules-load.d/mhwd-gpu.conf

set nvidia mode after and reboot, also make sure xorg-xrandr is installed before you reboot. without it this wont work

2 Likes

For now follow what @dglt told you to avoid further complications.

1 Like

thank you, it's work.
just have a problem with windows decoration and font size.

screenshots

(windows decoration on maximum it's good)
nvidia
nvidia2
nvidia3
nvidia4

if your talking about everything looking small when using nvidia mode then thats to be expected with KDE. i included a DPI option line in the nvidia config

sudo nano /etc/switch/nvidia/nvidia-xorg.conf

uncomment (remove the #) the DPI option line

Section "Device"
    Identifier "nvidia"
    Driver  "nvidia"
    BusID   "PCI:1:0:0"
    #Option  "DPI" "96 x 96"    #adjust this value as needed to fix scaling
    Option  "AllowEmptyInitialConfiguration"
EndSection

save/exit then set nvidia mode after to apply the changes. log out/in or reboot and the scaling should match that of intel mode

"96 x 96" can be adjusted to your liking

also, i noticed in your previous outputs you dont have certain nvidia optional packages installed like vulkan.

vulkan-icd-loader 
lib32-vulkan-icd-loader
libvdpau 
lb32-libvdpau

i thought they were part of the video-nvidia-* packages, but you might want to check. im on arch right now so no mhwd to verify

1 Like

these both tools (Optimus-manager and Optimus-switch) worked for me but my laptop power button has backlight color when it's intel mode color is blue and when going to Nvidia, color switching to orange (Windows). so before installing Nvidia using video-Linux, the color is blue but after install Nvidia and using these tools on the Intel mode color is Orange.
i think the problem is blacklisting nouveau.
i don't saw this problem on Ubuntu (using nouveau for intel mode?)
also, one time i removed intel conf file in /etc/modprobe.d (Optimus-switch) after reboot the color was back to blue (intel mode)
can we use nouveau for intel mode?

set intel mode and reboot, once your on a desktop is the light orange or blue?

then open a terminal and run

sudo /etc/switch/gpu_switch_check.sh

is the light now blue?

right now i'm on Optimus-manager.
when i was on optimus-switch intel mode (sudo set-intel.sh)
the color was orange (in /etc/modprobe.d intel conf file nouveau was blacklisted) but after removing the conf file and reboot color back to blue

Forum kindly sponsored by