bayasdev / envycontrol

Easy GPU switching for Nvidia Optimus laptops under Linux
https://bayas.dev/envycontrol
MIT License
1.14k stars 55 forks source link

[BUG] Error ocurred while enabling NVIDIA Persistence Daemon #150

Closed pedroborraz closed 6 months ago

pedroborraz commented 6 months ago

Describe the bug when trying to change the graphics to nvidia only, an error is shown to enable a service

To Reproduce Steps to reproduce the behavior:

  1. Run sudo envycontrol -s nvidia
  2. See error

System Information:

Additional context Add any other context about the problem here. If possible try to reproduce the problem with --verbose flag and attach its output.

Switching to nvidia mode
Enable ForceCompositionPipeline: False
Enable Coolbits: False
Failed to enable unit: Unit file nvidia-persistenced.service does not exist.
ERROR: An error ocurred while enabling service
INFO: Removed file /etc/X11/xorg.conf
INFO: Removed file /etc/modprobe.d/nvidia.conf
INFO: Found Nvidia GPU at 01:00.0
INFO: Found Intel iGPU
INFO: Created file /etc/X11/xorg.conf
# Automatically generated by EnvyControl

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

INFO: Created file /etc/modprobe.d/nvidia.conf
# Automatically generated by EnvyControl

options nvidia-drm modeset=1
options nvidia NVreg_UsePageAttributeTable=1 NVreg_InitializeSystemMemoryAllocations=0

INFO: Found gdm Display Manager
Rebuilding the initramfs...
Successfully rebuilt the initramfs!
Operation completed successfully
Please reboot your computer for changes to take effect!
bayasdev commented 6 months ago

Hi @pedroborraz, could you send me the output of:

systemctl --all | grep nvidia

Also I need to know how did you installed the Nvidia drivers (eg: akmod-nvidia from rpmfusion)?

Greetings :)

pedroborraz commented 6 months ago

output:

borraz@fedora:~$ systemctl --all | grep nvidia
  nvidia-fallback.service                                                                   loaded    inactive dead      Fallback to nouveau as nvidia did not load
  nvidia-powerd.service                                                                     loaded    inactive dead      nvidia-powerd service

I installed the drivers from the rpmfusion non free repo, from gnome software.

thanks for the quick attention

bayasdev commented 6 months ago

Looks like the rpmfusion package is missing the nvidia-persistenced dependency.

Try installing it with:

sudo dnf install nvidia-persistenced

Let me know if it works ;)

pedroborraz commented 6 months ago

this worked thank you very much, I will close the issue love u <3