On 17.04 everything worked fine. I can switch between gfx cards with
prime-select. It requires logout-login routine but works. In 17.10 I have issue with that. Switching from Intel to Nvidia works ok. After switch, I have to run command:
sudo systemctl restart display-manager
When I try back to Intel I can switch it with
prime-select, I can restart
display-manager and use Intel gfx but Nvidia modules are still used. I tried to to find what using Nvidia modules but without success.
$ lsmod | grep nvidia
nvidia_drm 45056 3
nvidia_modeset 843776 1 nvidia_drm
nvidia 13004800 1 nvidia_modeset
drm_kms_helper 167936 2 i915,nvidia_drm
drm 356352 26 i915,nvidia_drm,drm_kms_helper
I don't know what is using
I checked how
optirun behaves and it is same situation. After quit from program that was run as parameter of
optirun command, Nvidia modules cant be unloaded.
Update 2: Problem from Update 1 I resolved by fixing path to nvidia-persistentd in systemd service file. Now nvidia-persistentd service starts properly. But this is not solution for main problem.
Update 3 Dirty solution is to use magic sysrq combination with E
After this, I can unload Nvidia driver but it breaks some system services. Still searching perfect solution...
Update 4 I found that dbus service is blocking nvidia_drm module. After killing it I can remove nvidia modules from memory but Gnome not working fully. Even after restart of dbus service.