Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Something wrong with gentoo's nvidia driver
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
rahilarious
n00b
n00b


Joined: 12 Jan 2022
Posts: 2
Location: India

PostPosted: Wed Jan 12, 2022 8:13 pm    Post subject: Something wrong with gentoo's nvidia driver Reply with quote

The problem
Laptop with hybrid intel integrated graphics & nvidia mobile. Nvidia card rarely gets used. Just want to plug in HDMI and extend screen.

Note that nvidia driver works I could see it in nvidia-smi and prime. But xrandr just won't show HDMI on Gentoo, but works on other distros. Even Installed arch just to diagnose and it worked, also working on fedora popos LIVE IMAGES.

Here's what I tried but no luck
  • as fedora noveau was working, I tried noveau and blacklisted nvidia
  • tried with gentoo-kernel-bin
  • installed gnome
  • tried 470 & 495 versions.. both works on pop nd arch
  • read nvidia and optimus gentoo wikis thoroughly
  • used optimus xorg config from wiki. Xorg giving error
  • used xorg config generated with nvidia-xconfig. In this case HDMI screen works but laptop screen blank
  • made changes to xorg,udev,modprobe config inspired from arch's nvidia package

The effort
spent 2 days trying to get it working. Took it as challenge as if I was offended on why it doesn't work on my fav distro. as last resort posting here.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 50711
Location: 56N 3W

PostPosted: Wed Jan 12, 2022 8:29 pm    Post subject: Reply with quote

rahilarious,

Welcome to Gentoo.

Code:
nvidia-drivers
is an evil binary blob. Its the same for everyone, there is no Gentoo version.
In fact, it's knows to be the Widows code with a 'shim' to make it work with Linux rather than Windows.

On the good news side, it means that if it works on one distro, it can be made to work on any distro.

A long list of what doesn't work is not really helpful, so lets take small steps to narrow down the problem space.

First of all, use the modesettng driver to drive one display. The performance won't be very good but this is not a long term thing.
Its a means to an end. It has to be the modesetting driver as the Intel driver cannot be used in Optimus mode.

Once that works, add in the second display, still with the modesetting driver.
Check the Xorg.0.log to make sure that all is well.

Once this work, its time to add in nvidia-drivers.
When things don't work as you expect, tell what you did, tell what you expected, tell what actually happened and put your Xorg.0.log onto a pastebin site.
wgetpaste can help with pastebins.

Your
Code:
emerge --info
output and
Code:
lspci -nnk
output will be useful too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
rahilarious
n00b
n00b


Joined: 12 Jan 2022
Posts: 2
Location: India

PostPosted: Wed Jan 12, 2022 8:52 pm    Post subject: wow that was fast Reply with quote

NeddySeagoon wrote:
On the good news side, it means that if it works on one distro, it can be made to work on any distro.

That's what I thought and trying to figure out.
Quote:
A long list of what doesn't work is not really helpful, so lets take small steps to narrow down the problem space.

That's the procedure I followed to diagnose. I know it's not kernel related nor it's the module. It's somewhat in userspace.
Quote:
First of all, use the modesettng driver to drive one display. The performance won't be very good but this is not a long term thing.
Its a means to an end. It has to be the modesetting driver as the Intel driver cannot be used in Optimus mode.

Once that works, add in the second display, still with the modesetting driver.
Check the Xorg.0.log to make sure that all is well.

Most likely won't help but Will try anyway and read wiki on that.
Quote:
Once this work, its time to add in nvidia-drivers.

nvidia-drivers already works on the system. It shows up in lsmod, nvidia-smi I can use card with prime...just when HDMI plugs in nothing shows up in xrandr. Where in arch installing nvidia package does the job.

here is stuff u asked for

emerge info
lspci
lsmod
xorg conf that gives me display on HDMI but blank on laptop
xorg log that doesn't show HDMI is connected
successful xorg log from arch
fingers crossed

EDIT:
added xorg log


Last edited by rahilarious on Wed Jan 12, 2022 9:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 50711
Location: 56N 3W

PostPosted: Wed Jan 12, 2022 9:28 pm    Post subject: Reply with quote

rahilarious,

I can explain what's happening. Maybe that will help you fix it.

Hybrid graphics systems are actually one and a half graphics systems.
The Intel graphics can both render images into the (shared) pixel buffer and transfer the image to the display(s).
The higher power higher performance nVidia GPU can only render images into the pixel buffer. It has no connections to any displays.

This means that you can either use the Inter GPU on its own, or both GPUs together, which the Intel GPU only refreshes the displays with the image drawn by the nVidia GPU.

Code:
Section "Screen"
   Identifier "Screen0"
   Device     "Card0"
   Monitor    "Monitor0"
...
Section "Screen"
   Identifier "Screen1"
   Device     "Card1"
   Monitor    "Monitor1"
binds one screen on one GPU and the other to the other GPU. That can't work by design.

The Intel GPU must refresh both displays - and optionally, drow both images too or the Intel GPU must refresh both displays and the nVidia GPU draw the images for both displays.

From your log
Code:
[    10.394] (II) NVIDIA(G0): Validated MetaModes:
[    10.394] (II) NVIDIA(G0):     "NULL"
[    10.394] (II) NVIDIA(G0): Virtual screen size determined to be 640 x 480
[    10.397] (WW) NVIDIA(G0): Cannot find size of first mode for SAMSUNG (DFP-0); cannot
[    10.397] (WW) NVIDIA(G0):     compute DPI from SAMSUNG (DFP-0)'s EDID.
[    10.397] (==) NVIDIA(G0): DPI set to (75, 75); computed from built-in default
That's the nVidia GPU failing to connect to the display, as expected.

Do you need to add "xinerama" to your use flags?
I have one 43" display, so I've not tested with multiple displays.

You will need either Optimus or Prime too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum