Well, finally I was able to solve the problem. It wasn't the way I wanted it, but the most important thing is that now is solved.
For this, I tried to imitate what Ubuntu (I think) does. I proceeded to disable the integrated GPU to exclusively use the discrete GPU, without using BIOS. The ideal solution would have been to make it work properly with Bumblebee, but it was getting out of my hands and I went through 11 fresh Debian installations, piles of threads and attempts at solution. All were "patches", nothing to fix it from root.
Regarding the "non-recognition" of lspci (and nvidia-detect) command, what probably happens is that it doesn't have built-in recognition of the new GPUs yet and that is why when we use that command shows only a part of the GPU ID.
As I promised, I'll left a step-by-step guide to what I did to be able to walk the discreet GPU. I would like to mention that although I based the tutorial on Debiban's wikis, these wikis aren't properly drafted and aren't complete. There are important things that are not properly clarified or mentioned, forcing the user to "guess" certain things that for some may be trivial and for others not.
Here we go...
--------------------------------------------------------------------------------------------------------------
Pros and cons of this solution
--------------------------------------------------------------------------------------------------------------
First, I would like to mention the pros and cons that I found with this solution.
Pros:
+ We can get more performance from the Nvidia GPU, regarding if we didn't use the official drivers.
+ In cases where correspond, we can take advantage of the use CUDA support.
Cons:
- The GPU is constantly on, which generates more power consumption and therefore reduces the battery life.
- A few degrees of temperature are appreciated more than using only the onboard GPU or even Bumblebee. This point seems to me more worrying than the previous one, since the temperature and the
batterie life arent good friends considering some laptops don't offer the possibility to remove the battery when we use the power adapter.
--------------------------------------------------------------------------------------------------------------
Guide: how to install Nvidia drivers on Optimus system and using only the discrete GPU
--------------------------------------------------------------------------------------------------------------
OS: Debian Stretch
Desktop: GNOME
Drivers version: 375.66
Important: This guide is intended for someone who has just completed a fresh installation of Debian. We consider that we already know our model of GPU Nvidia and that's covered in the version of drivers that we're going to use.
Step 1
Add "contrib" and "non-free" components to /etc/apt/sources.list, for example
Code: Select all
deb http://httpredir.debian.org/debian/ stretch main contrib non-free
Step 2
Update the list of available packages. Install the appropriate linux-headers and kernel module packages:
Code: Select all
# apt-get update
# apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-driver
Step 3
Ensure xrandr is installed and available
Code: Select all
# apt-get install x11-xserver-utils
Step 4
Create an
xorg.conf under
/etc/X11/xorg.conf and add the following:
Code: Select all
Section "Module"
Load "modesetting"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:X:Y:Z"
Option "AllowEmptyInitialConfiguration"
EndSection
# Insert any additional custom configurations, below:
Where "BusID" X:Y:Z are the shortened/truncated numbers from the ID gathered by
lspci | grep 3D. For example, if the output of
lspci | grep 3D displayed a PCI ID of 09:00.0, the BusID entry would read: BusID "9:0:0"
Step 5
Create a custom script,
/usr/local/bin/switch_nvidia.sh:
Code: Select all
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
xrandr --dpi 96
The DPI setting, (--dpi) should be fine for most screens; however, this may need to be adjusted for newer high density pixel screens. Systems with HiDPI screens likely will want to set this to 192. Consult your hardware manufacturer's specification for the appropriate setting.
Step 6
Make the script executable:
Code: Select all
# chmod +x /usr/local/bin/switch_nvidia.sh
Step 7
Create a two new .desktop files -
/usr/share/gdm/greeter/autostart/optimus.desktop and
/etc/xdg/autostart/optimus.desktop about following content:
Code: Select all
[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer
Step 7
Reboot the system.
Step 8
Enjoy the drivers.
--------------------------------------------------------------------------------------------------------------
Verify the discrete GPU is working
--------------------------------------------------------------------------------------------------------------
1. Install inxi
and reboot.
Then call
inxi -G, you should get something like this
Code: Select all
$ inxi -G
Graphics: Card-1: Intel Device 591b
Card-2: NVIDIA Device 1c8d
Display Server: X.Org 1.19.2 drivers: modesetting,nvidia
Resolution: 1920x1080@60.01hz
GLX Renderer: GeForce GTX 1050/PCIe/SSE2
GLX Version: 4.5.0 NVIDIA 375.66
2. Run
You must have a large number of FPS. For example, on a GTX 1050 it has ~5000fps while with the Intel and Bumblebee had ~70fps.
Note: In some cases could be usefull install
firmware-linux with contrib and non-free repositories.
--------------------------------------------------------------------------------------------------------------
Sources:
--------------------------------------------------------------------------------------------------------------
NVIDIA Proprietary Driver
NVIDIA Optimus
--------------------------------------------------------------------------------------------------------------
Feel free to share, edit or comment this guide. I hope this help someone. Cheers!