Page 1 of 1

How To install and switch to nvidia driver, disable i915 intel vga

Posted: 2023-05-03 15:33
by alirezaimi
Hi
I connect two monitor with hdmi cable and vga to my asus R542U laptop and there is problem in debian gnome desktop that the resolution of two monitor is not same and the vga connected one can't change after 1024, but the hdmi monitor have 1920 resolution !

I tested in windows 10 and everything is ok and both monitor have same resolution :(
I think this problem come from the intel vga or free nvidia driver, so I want to use the main nvidia driver only, and for that i install the nvidia driver :

Code: Select all

# apt-cache policy nvidia-driver
nvidia-driver:
  Installed: 525.105.17-1
  Candidate: 525.105.17-1
  Version table:
 *** 525.105.17-1 500
        500 http://mirror.aminidc.com/debian testing/non-free amd64 Packages
        100 /var/lib/dpkg/status

Code: Select all

# apt-cache policy xserver-xorg-video-nvidia
xserver-xorg-video-nvidia:
  Installed: 525.105.17-1
  Candidate: 525.105.17-1
  Version table:
 *** 525.105.17-1 500
        500 http://mirror.aminidc.com/debian testing/non-free amd64 Packages
        100 /var/lib/dpkg/status
And remove free nvidia driver :

Code: Select all

# apt-cache policy xserver-xorg-video-nouveau 
xserver-xorg-video-nouveau:
  Installed: (none)
  Candidate: 1:1.0.17-2
  Version table:
     1:1.0.17-2 500
        500 http://mirror.aminidc.com/debian testing/main amd64 Packages
When i reboot and test again the result is same and intel driver not disable !

Code: Select all

# lspci -nnk | egrep -i --color 'vga|3d|2d' -A3 | grep 'in use'
	Kernel driver in use: i915
	Kernel driver in use: nvidia
I'm on debian testing :

Code: Select all

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
I attach some images for more info ,
Screenshot from 2023-05-03 18-59-55.png
How can i switch to nividia driver ?
thanks.

Re: How To install and switch to nvidia driver, disable i915 intel vga

Posted: 2023-05-03 19:47
by Aki
Hello,

You can verify in the computer's BIOS if is it possible to disable the intel integrated GPU leaving active only the nvidia discrete GPU.

If it is not possible and if both GPUs are connected to both video output (HDMI and VGA), you could disable the i915 kernel module creating a blacklist file in /etc/modprobe.d/ (see [1])

---
[1] https://wiki.debian.org/KernelModuleBlacklisting

Re: How To install and switch to nvidia driver, disable i915 intel vga

Posted: 2023-05-04 05:26
by alirezaimi
Aki wrote: 2023-05-03 19:47 Hello,

You can verify in the computer's BIOS if is it possible to disable the intel integrated GPU leaving active only the nvidia discrete GPU.

If it is not possible and if both GPUs are connected to both video output (HDMI and VGA), you could disable the i915 kernel module creating a blacklist file in /etc/modprobe.d/ (see [1])

---
[1] https://wiki.debian.org/KernelModuleBlacklisting
Thanks for your reply,
I checked the BIOS and there is no config option available for this matter,
And as you suggested i created a blacklist modprob and reboot it but its not work , i do not know why ? :(
I add this file :

Code: Select all

# cat /etc/modprobe.d/blacklist-intel.conf
blacklist i915
And tun update-initramfs -u and then reboot system , but no hope :(

Another Question is : why one item in this list shown to me ?!

Code: Select all

$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x45 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 4 associated providers: 0 name:modesetting

Re: How To install and switch to nvidia driver, disable i915 intel vga

Posted: 2023-05-05 15:49
by alirezaimi
I managed to install nvidia driver from its site successfully , and this is output of xrandr:

Code: Select all

$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x45 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 4 associated providers: 0 name:modesetting
Provider 1: id: 0x23f cap: 0x0 crtcs: 0 outputs: 0 associated providers: 0 name:NVIDIA-G0
But the problem still exist and i can't disable intel i915 driver or switch to nvidia driver completely .
Screenshot from 2023-05-05 19-17-46.png
I added intel i915 to blacklist and not work .

Re: How To install and switch to nvidia driver, disable i915 intel vga

Posted: 2023-05-05 16:25
by Aki
alirezaimi wrote: 2023-05-05 15:49 But the problem still exist and i can't disable intel i915 driver or switch to nvidia driver completely .
You can force not to load the i915.ko kernel module somehow, but the display server will probably start a VESA/framebuffer kernel module to drive the intel GPU, anyway. Perhaps you can configure the graphic server to start using nvidia kernel driver only, but I never tried such a configuration, so far.

Re: How To install and switch to nvidia driver, disable i915 intel vga

Posted: 2023-05-06 00:24
by CynicalDebian
alirzaimi wrote: I managed to install nvidia driver from its site successfully , and this is output of xrandr:
Read about why that is a bad idea and why you should revert to the one Debian provides:
https://wiki.debian.org/DontBreakDebian ... ll_scripts

alirzaimi wrote: I think this problem come from the intel vga or free nvidia driver, so I want to use the main nvidia driver only, and for that i install the nvidia driver :
You are using NVIDIA Optimus, it is probably not a good idea to try and turn off your iGPU. Read more about Nvidia Optimus:
https://wiki.debian.org/NVIDIA%20Optimus

To get the missing resolution, you can try forcefully adding the mode in xrandr.

Code: Select all

$cvt 1920 1080
1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
$xrandr --newmode Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
$xrandr --addmode VGA-0 1920x1080_60.00
$xrandr --output VGA-0 --mode 1920x1080_60.00
Since I haven't seen your XRANDR I have taken a guess that your VGA output is named "VGA-0", you should adjust it by checking

Code: Select all

$xrandr
And finding the proper output name

Re: How To install and switch to nvidia driver, disable i915 intel vga

Posted: 2023-05-07 13:28
by alirezaimi
CynicalDebian wrote: 2023-05-06 00:24
alirzaimi wrote: I managed to install nvidia driver from its site successfully , and this is output of xrandr:
Read about why that is a bad idea and why you should revert to the one Debian provides:
https://wiki.debian.org/DontBreakDebian ... ll_scripts

alirzaimi wrote: I think this problem come from the intel vga or free nvidia driver, so I want to use the main nvidia driver only, and for that i install the nvidia driver :
You are using NVIDIA Optimus, it is probably not a good idea to try and turn off your iGPU. Read more about Nvidia Optimus:
https://wiki.debian.org/NVIDIA%20Optimus

To get the missing resolution, you can try forcefully adding the mode in xrandr.

Code: Select all

$cvt 1920 1080
1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
$xrandr --newmode Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
$xrandr --addmode HDMI-0-A 1920x1080_60.00
$xrandr --output VGA-0 --mode 1920x1080_60.00
Since I haven't seen your XRANDR I have taken a guess that your VGA output is named "VGA-0", you should adjust it by checking

Code: Select all

$xrandr
And finding the proper output name
Thanks for your reply ,
I did this and solve my problem ,almost !
thanks .

Re: How To install and switch to nvidia driver, disable i915 intel vga

Posted: 2023-05-07 13:33
by CynicalDebian
@alirezaimi

What display configuration do you want? Do you believe your display port connected monitor should be to driven at 1080p? In your original post you said this was a "VGA" monitor, so now I am a bit confused.

Here is the commands you should run if you think it can run at 1080p 60 Hz!

Code: Select all

$xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
$xrandr --addmode DP-1 1920x1080_60.00
$xrandr --output DP-1 --mode 1920x1080_60.00

Re: How To install and switch to nvidia driver, disable i915 intel vga

Posted: 2023-05-08 04:33
by alirezaimi
CynicalDebian wrote: 2023-05-07 13:33 @alirezaimi

What display configuration do you want? Do you believe your display port connected monitor should be to driven at 1080p? In your original post you said this was a "VGA" monitor, so now I am a bit confused.

Here is the commands you should run if you think it can run at 1080p 60 Hz!

Code: Select all

$xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
$xrandr --addmode DP-1 1920x1080_60.00
$xrandr --output DP-1 --mode 1920x1080_60.00
I successfully managed to set this config . Thanks Youuuu .
I script it like this :

Code: Select all

#!/usr/bin/bash

#xrandr

x=1680
y=1050
hz=60

cvt_out=$(cvt ${x} ${y} ${hz} | sed -n 2p | awk '{$1="";print $0}');
echo $cvt_out
xrandr --newmode $cvt_out

cvt_resl=$(cvt ${x} ${y} ${hz} | sed -n 2p | awk '{print $2}');
echo $cvt_resl
xrandr --addmode DP-1 $cvt_resl

## set custom resolution 
xrandr --output DP-1 --mode $cvt_resl
I do not know why can't set 1920*1080 ! when i set it the picture that show on screen was very bad and irregular .

Re: How To install and switch to nvidia driver, disable i915 intel vga

Posted: 2023-05-08 14:52
by CynicalDebian
@alirezaimi

Are you using a Display Port to VGA adapter? Or any kind of adapter at all? Or is this pure display port to display port?

If you are using an adapter, you may have a poor quality adapter that is causing issues.

Windows seems to cope much better with shoddy display hardware than Linux does (In my experience), so you might try with a different cable.