Must restart system to switch to nvidia
See original GitHub issueDescribe the bug
Can switch to nvidia driver if I set it as startup. Can switch back to intel and relogin to apply. Cannot switch to nvidia unless a full restart is applied. No error trying to switch to nvidia in session, but it just doesn’t switch. Modprobe error in the gpu_setup.log
below.
System info
- Arch 5.4.15-arch1-1
- KDE
- Dell G3, nvidia 1050M GTX
- latest Git version (optimus-manager-git)
Logs boot_setup.log gpu_setup.log prime_setup.log
pacman -Q | grep nvidia
nvidia 440.44-15
nvidia-utils 440.44-3
[root@xonq /]# lsmod | grep "kms\|drm"
nvidia_drm 49152 5
nvidia_modeset 1118208 7 nvidia_drm
drm_kms_helper 212992 2 nvidia_drm,i915
drm 520192 9 drm_kms_helper,nvidia_drm,i915
agpgart 53248 2 intel_gtt,drm
syscopyarea 16384 1 drm_kms_helper
sysfillrect 16384 1 drm_kms_helper
sysimgblt 16384 1 drm_kms_helper
fb_sys_fops 16384 1 drm_kms_helper
[root@xonq modprobe.d]# grep LoadModule /var/log/Xorg.0.log
[ 8.725] (II) LoadModule: "glx"
[ 8.741] (II) LoadModule: "nvidia"
[ 8.751] (II) LoadModule: "modesetting"
[ 8.758] (II) LoadModule: "fb"
[ 8.760] (II) LoadModule: "wfb"
[ 8.761] (II) LoadModule: "ramdac"
[ 8.774] (II) LoadModule: "glxserver_nvidia"
[ 8.914] (II) LoadModule: "glamoregl"
[ 9.165] (II) LoadModule: "fb"
[ 9.244] (II) LoadModule: "dri2"
[ 9.746] (II) LoadModule: "libinput"
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
NVIDIA installer cannot continue, a system restart is required ...
This is for those of us who are struggling to get the installer to work as it simply wont work but restarting the...
Read more >PC Automatically Restart and turn off after NVIDIA Driver ...
After i update my NVIDIA Drivers from 419.67 to 425.31, my PC Suddenly restart or even turn off automatically without any warning, BSOD,...
Read more >Manage 3D Settings (reference) - NVIDIA
To allow the "Preferred Graphics Processor" settings to take effect, you must restart the program. Restore button (bottom corner) restores the default ...
Read more >How to Reset a Graphics Card on Windows - groovyPost
To restart your graphics card, press the Windows key + Ctrl + Shift + B combination on your keyboard. Your screen will briefly...
Read more >"Something went wrong. Try restarting GeForce Experience ...
Press the Windows Key on your keyboard. · Type “msconfig” (no quotes), then hit Enter. The System Configuration window should come up. ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Figured out the problem as per the FAQ you have to
so
prime-switch
needed to run as root after every Xserver exit, without display manager you have to make it run manually to make the switch,Auto
~/.xinitrc
you run your window manager for exampleexec i3
replace it with onlyi3
/etc/sudoers
adding this lineYourUserName ALL = NOPASSWD: /usr/bin/prime-switch
to prevent it from requiring a password when writingsudo /usr/bin/prine-switch
sudo /usr/bin/prime-switch
Then end of the .xinitrc will be-that’s it
Problem with this
prime-switch
before the xserver is fully killed so this error is producedSetting up base state Unloading modules ['nvidia_drm', 'nvidia_modeset', 'nvidia'] (if loaded) Cannot setup GPU : kernel setup error : Cannot unload modules ['nvidia_drm', 'nvidia_modeset', 'nvidia'] : Failed to execute 'modprobe -r nvidia_drm nvidia_modeset nvidia' : modprobe: FATAL: Module nvidia_drm is in use.
soultion
.bash_profile
having thestartx
commandsudo /usr/bin/prine-switch
.bash_profile
isManually
optimus-manager.conf
auto_logout=no
/usr/bin/prime-switch
as rootThanks @ahegazy, your solution works great!
Also if anyone using sudo with password like me, you can add this line to
/etc/sudoers
withvisudo
to allow thesudo /usr/bin/prime-switch
command to run without a password: