The case
I was trying to record the screen and sound with a laptop Avell (Clevo
in Brazil). This laptop has I5 processor, and a hybrid video card (intel
and Nvidia 1050), with Pop!_OS Linux distro
and Gnome. All was quite fine for while, but after install
Kazam (it is a great Software) I could
not run it. Why? Because the icon systray
was removed from Gnome and
the plugin Top icon did not work. Furthermore the shortcut did not work
as well.
Pop!_OS (It is an amazing Distro) has no another official Desktop Environment, thus I decided to change to my preferred Distro: Debian. I tried Debian before but I had some issues (look here).
It was a rainy Saturday and a new opportunity to install Debian has been arrived. I had several issues, but in summary the problems were:
- Nouveau conflict;
- Nvidia driver;
- How to activate Nvidia GPU;
- How to return to Intel.
After 18 hours researching, reading, watching videos, trying, and 2 new installations, a solution was found. As a didactic content I will share the experience.
Solution
Almost all solution was on Debian Nvidia, Debian Optimus and Debian lightdm.
Nvidia Driver Installation
- Enable non-free repository
/etc/apt/sources.list
apt-get update
- if after the login your system is freezing the problem is NOUVEAU, edit the files as follow:
- nano /etc/modprobe.d/blacklist.conf :
blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off
- nano /etc/default/grub and add the nouveau.modeset=0 part :
GRUB_CMDLINE_LINUX_DEFAULT="nouveau.modeset=0 quiet"
- nano /etc/modprobe.d/nouveau-kms.conf (if you have the file):
options nouveau modeset=0
GRUB_CMDLINE_LINUX_DEFAULT="nouveau.modeset=0 quiet"
- update grub and reboot
update-grub
reboot
- Install nvidia-detect utility by execution of the below command:
apt -y install nvidia-detect
- Detect your Nvidia card model and suggested Nvidia driver. To do so
execute the above installed nvidia-detect command:
nvidia-detect
- As suggested install the recommended driver by the previous step:
apt-get install nvidia-driver
- Reboot
systemctl reboot
Configuration
Hybrid card: I tried Bumblebee, but NO SUCCESS!
Another attempt was xrandr
, IT WORKS!.
- Ensure xrandr is installed and available:
apt-get install x11-xserver-utils
- Modify or create (if one doesn’t exist) an
xorg.conf
under/etc/X11/xorg.conf
; add the following:
Section "Module"
Load "modesetting"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:X:Y:Z"
Option "AllowEmptyInitialConfiguration"
EndSection
# Section "Device"
# Identifier "intel"
# Driver "modesetting"
# BusID "PCI:X:Y:Z"
# Option "AllowEmptyInitialConfiguration"
# EndSection
Where “BusID” X:Y:Z are the shortened/truncated numbers from the ID
gathered above. For example, if the output of lspci -nnk | grep -i 'VGA|3d'
displayed a PCI ID of 09:00.0, the BusID entry would read:
BusID “09:00:0”
- Add/create a custom script,
/usr/local/bin/switch_nvidia.sh
:
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
xrandr --dpi 96
-
Make the script executable:
chmod +x /usr/local/bin/switch_nvidia.sh
-
Configure your desired display manager to use a setup script during display setup. In my case was LightDM.
-
Modify lightdm’s configuration and add (if one doesn’t already exist) a SeatDefaults section & script config. For Debian, lightdm config file is in
/etc/lightdm/lightdm.conf
[SeatDefaults]
display-setup-script=/usr/local/bin/switch_nvidia.sh
-
Update:
systemctl restart lightdm.service
-
Test:
glxinfo | grep "OpenGL renderer"
andglxgears
andglxheads
.
How to return to Intel Video Card
Go to step 2. and change the no comment lines Section "Device"
:
Section "Module"
Load "modesetting"
EndSection
#Section "Device"
# Identifier "nvidia"
# Driver "nvidia"
# BusID "PCI:X:Y:Z"
# Option "AllowEmptyInitialConfiguration"
#EndSection
Section "Device"
Identifier "intel"
Driver "modesetting"
BusID "PCI:X:Y:Z"
Option "AllowEmptyInitialConfiguration"
EndSection
After go to step 6. and comment the line with
display-setup-script=/usr/local/bin/switch_nvidia.sh
.
Repeat step 7.