Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nvidia-drivers-340.108
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Brumi-2021
n00b
n00b


Joined: 17 Oct 2021
Posts: 7

PostPosted: Sun Aug 07, 2022 8:21 am    Post subject: nvidia-drivers-340.108 Reply with quote

Hi Shibotto and Ionen, and Randy Andy ,

Recently I opened a thread about general Opengl problems , with an old recycled laptop, with GPU : NVIDIA Geforce 9300M GS .
https://forums.gentoo.org/viewtopic-p-8735719.html#8735719

But after checking re recently , sudo dsmesg output , I think it is directly related to all this previous threat . (apologize for it)

I could read that in that link , I can find my needed NVIDIA driver (nvidia-drivers-340.108-r4.ebuild) ,
https://github.com/achurch/noglvnd


I already masked the , >=x11-drivers/nvidia-drivers-390.154 (to block the supported current gentoo NVIDIA drivers)

[TXT] nvidia-drivers-390.1..> 12-Jun-2022 19:10 14K
[TXT] nvidia-drivers-390.1..> 02-Aug-2022 20:40 14K
[TXT] nvidia-drivers-470.1..> 12-Jun-2022 19:10 15K
[TXT] nvidia-drivers-470.1..> 02-Aug-2022 20:40 15K
[TXT] nvidia-drivers-510.7..> 12-Jun-2022 19:10 15K
[TXT] nvidia-drivers-510.8..> 02-Aug-2022 20:40 15K
[TXT] nvidia-drivers-515.4..> 21-Jul-2022 08:10 17K
[TXT] nvidia-drivers-515.5..> 28-Jun-2022 19:40 17K
[TXT] nvidia-drivers-515.6..> 02-Aug-2022 20:40 17K


But I am not sure , the commands that I need to do
for installing the old nvidia-drivers-340.108-r4 ,
and to integrate it correctly to the my kernel version , inux-5.18.13-pentoo

I could also read on above posts, that shiboto created and excellent new nvidia legacy 340 repo
https://gitlab.com/shibotto/nvidia-legacy
I read the instructions , and seems clear , but I think it would not work with my kernel linux 5.18. 13 .

Congratulations for your great job and strong support to the community!

Any help or guide will be highly appreciated,
Cheers,
Back to top
View user's profile Send private message
rogge
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2006
Posts: 132
Location: Erfurt

PostPosted: Thu Mar 16, 2023 9:03 am    Post subject: Reply with quote

Here your'll find patches for newer Kernels:

https://aur.archlinux.org/packages/nvidia-340xx
Back to top
View user's profile Send private message
rogge
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2006
Posts: 132
Location: Erfurt

PostPosted: Thu Mar 16, 2023 10:25 pm    Post subject: Reply with quote

Hello again,

I tried to compile the uptodate nvidia-kmod for Kernel 5.15.94, but it failed, again and again and I really don't know why.

Quote:
{ echo /var/tmp/portage/x11-drivers/nvidia-kmod-340.108/work/kernel/nvidia.ko; :; } | awk '!x[$0]++' - > /var/tmp/portage/x11-drivers/nvidia-kmod-340.108/work/kernel/modules.order
sh ./scripts/modules-check.sh /var/tmp/portage/x11-drivers/nvidia-kmod-340.108/work/kernel/modules.order
make -f ./scripts/Makefile.modpost
sed 's/\.ko$/\.o/' /var/tmp/portage/x11-drivers/nvidia-kmod-340.108/work/kernel/modules.order | scripts/mod/modpost -o /var/tmp/portage/x11-drivers/nvidia-kmod-340.108/work/kernel/Module.symvers -e -i Module.symvers -T -
ERROR: modpost: "agp_backend_release" [/var/tmp/portage/x11-drivers/nvidia-kmod-340.108/work/kernel/nvidia.ko] undefined!
ERROR: modpost: "agp_copy_info" [/var/tmp/portage/x11-drivers/nvidia-kmod-340.108/work/kernel/nvidia.ko] undefined!
ERROR: modpost: "agp_unbind_memory" [/var/tmp/portage/x11-drivers/nvidia-kmod-340.108/work/kernel/nvidia.ko] undefined!
ERROR: modpost: "agp_free_memory" [/var/tmp/portage/x11-drivers/nvidia-kmod-340.108/work/kernel/nvidia.ko] undefined!
ERROR: modpost: "agp_backend_acquire" [/var/tmp/portage/x11-drivers/nvidia-kmod-340.108/work/kernel/nvidia.ko] undefined!
ERROR: modpost: "agp_find_bridge" [/var/tmp/portage/x11-drivers/nvidia-kmod-340.108/work/kernel/nvidia.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:133: /var/tmp/portage/x11-drivers/nvidia-kmod-340.108/work/kernel/Module.symvers] Error 1
make[2]: *** Deleting file '/var/tmp/portage/x11-drivers/nvidia-kmod-340.108/work/kernel/Module.symvers'
make[1]: *** [Makefile:1818: modules] Error 2
make[1]: Leaving directory '/usr/src/linux-5.15.94-gentoo'
NVIDIA: left KBUILD.
nvidia.ko failed to build!


Please tell me, if you need some more information about this case.
Back to top
View user's profile Send private message
Mistwolf
Apprentice
Apprentice


Joined: 07 Mar 2007
Posts: 189
Location: Edmonton, AB

PostPosted: Tue Mar 21, 2023 9:58 pm    Post subject: Reply with quote

Known issue, see here: https://gitlab.com/shibotto/nvidia-legacy/-/issues/2
Back to top
View user's profile Send private message
rogge
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2006
Posts: 132
Location: Erfurt

PostPosted: Thu Mar 23, 2023 11:25 am    Post subject: Reply with quote

Mistwolf wrote:
Known issue, see here: https://gitlab.com/shibotto/nvidia-legacy/-/issues/2


Thanks a lot! I was really wondering, because I got the same error with 5.15.102 and the downgraded 5.10.174 and my FX 3800 is connected via pciee. So actually no need for AGP.
Back to top
View user's profile Send private message
nuku97
n00b
n00b


Joined: 14 Apr 2023
Posts: 3

PostPosted: Fri Apr 14, 2023 5:47 am    Post subject: QT applications segfault with nvidia-driver 340 Reply with quote

Hallo everyone,

I use the driver x11-drivers/nvidia-drivers-340.108-r101:0/340::nvidia-legacy on my old notebook with Nvidia Quattro NVS 160M graphics card, because the OpelnGL performance of open source Nouveau for this card is really bad in games.

I didn't really use my notebook during the last 1,5 years but kept updating it regulary, to have it ready for use whenever needed. Now I had to use it again but unfortunately noticed a problem related to the graphics driver, but don't know exactly when or with which package update this problem was introduced:

When using the nvidia-driver above, most QT/KDE application crash with a segmentation fault, dmesg reporting something like this:

Code:
[  827.938059] konsole[3683]: segfault at 0 ip 0000000000000000 sp 00007ffcd745b928 error 14 in konsole[55b9167e0000+4000]
[  827.938072] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.


However, I can start the QT application when running it with command:
Code:
LD_PRELOAD=/usr/lib64/libGL.so konsole


As far as I understand, that way, the libGL.so from Mesa/libglvnd will be used instead of nvidia's drivers one.

I googled and found a few threads from somebody else reporting this problem in various forums, but never a solution.

Previously all applications worked fine with the legacy nvidia driver.

There seems some kind of explanation at this thread:

https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1894504.html

However, I have no idea how to fix my system now in order to be able to run games with the Nvidia driver while using KDE/QT apps at the same time without the preload command.

Anyone else having these issues and a solution how to run a KDE desktop with this driver?

Thanks
Florian


Some more discussions I found about this:
https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1895487.html
https://forums.debian.net/viewtopic.php?t=153892
https://forums.developer.nvidia.com/t/qt-5-15-4-and-upper-nvidia-driver-340-108-segmentation-fault-of-all-qt-soft/242956
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Fri Apr 14, 2023 2:46 pm    Post subject: Reply with quote

As I read that thread, the solution is that you need to use libglvnd, rather than directly loading libGL.so from nvidia-drivers. Is your notebook unable to use any newer nVidia drivers than the 340 series? Remaining on such an old series is likely to cause you more problems as time passes.
Back to top
View user's profile Send private message
logrusx
Veteran
Veteran


Joined: 22 Feb 2018
Posts: 1535

PostPosted: Fri Apr 14, 2023 4:03 pm    Post subject: Reply with quote

Hu wrote:
Is your notebook unable to use any newer nVidia drivers than the 340 series?


If somebody ends up here, that's surely the case.

nuku97 I hate to say it, but you either write a wrapper library or move on. I guess if writing a wrapper library was simple, someone should have done it alreday, so...

Best Regards,
Georgi
Back to top
View user's profile Send private message
nuku97
n00b
n00b


Joined: 14 Apr 2023
Posts: 3

PostPosted: Sun Apr 16, 2023 12:31 pm    Post subject: Reply with quote

Hi all,

thanks for your responses.

Yes, this driver is unfortunately the last driver for my notebook's Nvidia Quatro NVS 160M card. After all, the notebook (Dell E6400) is from 2009... and yes, I already expected this trouble with the closed source driver. Still, the notebook is good enough for my use cases (used only a few weeks per year when visiting parents or parents in law), while my daily driver is now a powerful desktop with - of course - an AMD Radeon card and open source drivers ;-)

But back to the topic, in case somebody is interested:

I spend a few more hours and changed the overlay from nvidia-legacy to noglvnd (https://github.com/achurch/noglvnd), which was also mentioned somewhere above in this thread, getting rid of libglvnd and restoring the old "eselect opengl" behaviour. Of course I used emerge and revdep-rebuild to rebuild all packages with changed USE flags and library deps. But still: the QT/KDE apps crash just like before.

So this seems not (just) to be a problem with libglvnd, but maybe a problem with QT. In some other forum posts on the internet, somebody writes that this problem with the nvidia-driver occurs since Qt 5.15.4. Looking at the changelogs of the portage tree and comparing them to the last time I was really using the notebook about 1,5 years ago, indeed the QT version was lower than this at that time. I tried to downgrade QT but quickly gave up due to dependencies of latest stable KDE packages. And I don't think it makes sense to invest much more time and downgrade also all the KDE packages etc. Also, I tried to compile all kde-*/* and dev-qt/* with USE=-opengl, to no success.

So, my conclusion:
- for now, I will either use Nouveau with KDE for productivity or Nvidia-drivers with ICEWM for "gaming". Might try another lightweight DE without QT like LxDE to replace KDE....
- will continue to watch this thread, maybe someone comes up with a solution after all, who knows...
- in case I will buy a new notebook, I will try to grab one with a Radeon....

Have a nice day!
Florian
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Sun Apr 16, 2023 4:37 pm    Post subject: Reply with quote

If you want to pursue this further, understanding the exact nature of the crash might be helpful to know which component(s) are at fault. We would want to see the full backtrace, with symbols. Register context may or may not help.
Back to top
View user's profile Send private message
Geneslaf
n00b
n00b


Joined: 07 Jul 2014
Posts: 8

PostPosted: Sun May 28, 2023 1:44 pm    Post subject: Reply with quote

nuku97 wrote:

- will continue to watch this thread, maybe someone comes up with a solution after all, who knows...


May not be a comprehensive solution but in my case ffmpeg and nvidia-settings were segmentation faulting however if I preload /lib64/libpthread.so.0 they run OK.

Code:

$ /usr/bin/ffmpeg -hide_banner -nostats -loglevel error -i from.mp3 -y to.mp3
Segmentation fault
$ LD_PRELOAD=/lib64/libpthread.so.0 /usr/bin/ffmpeg -hide_banner -nostats -loglevel error -i from.mp3 -y to.mp3
$


Mark
Back to top
View user's profile Send private message
JanR
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jan 2007
Posts: 78

PostPosted: Mon Jun 19, 2023 8:01 pm    Post subject: Reply with quote

Quote:

May not be a comprehensive solution but in my case ffmpeg and nvidia-settings were segmentation faulting however if I preload /lib64/libpthread.so.0 they run OK.


Thank you for that idea!

It solved my problem (crashes with many QT-programs and nvidia 340 driver from overlay) too.

Problem description:

https://forums.gentoo.org/viewtopic-p-8792666.html#8792666

Interesting observation: I get no crashes when starting in gdb or strace. Therefore, I guess a timing problem with these libraries. It seems that preloading the pthread library has the same effect.
Back to top
View user's profile Send private message
Geneslaf
n00b
n00b


Joined: 07 Jul 2014
Posts: 8

PostPosted: Tue Jun 20, 2023 7:10 pm    Post subject: Reply with quote

JanR wrote:
Quote:

May not be a comprehensive solution but in my case ffmpeg and nvidia-settings were segmentation faulting however if I preload /lib64/libpthread.so.0 they run OK.

Thank you for that idea!

It solved my problem (crashes with many QT-programs and nvidia 340 driver from overlay) too.

Interesting observation: I get no crashes when starting in gdb or strace. Therefore, I guess a timing problem with these libraries. It seems that preloading the pthread library has the same effect.

Thank you for confirming that is solves the QT problems as well - I don't run anything with QT so was wondering if it was the same underlying problem.

As far as I can tell the problem has nothing to do with timings or memory layout, its caused by what the nvidia code is doing. In my case with ffmpeg the crash was caused by a call of pthread_create. I discovered that libGL.so is inserting a wrapper around the pthread_create call but if libpthread.so is not loaded then it fails to fill in the address for the call to the real pthread_create. The nvidia libraries are supplied as binaries and were compiled in 2019 before the stuff in libpthread.so was moved into libc.so so it sort of makes sense that it does not look for the real pthread_create address if libpthread.so is not loaded. The fix had nothing to do with memory layout, its because something inside libGL.so is done only if something called libpthread.so is loaded.
Code:

$ /usr/bin/ffmpeg -hide_banner -nostats -loglevel error -i from.mp3 -y to.mp3
Segmentation fault
$ gcc -shared -o libpthread.so /dev/null
$ LD_PRELOAD=${PWD}/libpthread.so /usr/bin/ffmpeg -hide_banner -nostats -loglevel error -i from.mp3 -y to.mp3
$ mv libpthread.so libfoobar.so
$ LD_PRELOAD=${PWD}/libfoobar.so /usr/bin/ffmpeg -hide_banner -nostats -loglevel error -i from.mp3 -y to.mp3
$ Segmentation fault

or using a non empty library
Code:

$ ldd /usr/bin/ffmpeg | grep libncurses
$ cp /lib64/libncurses.so.6 .
$ LD_PRELOAD=${PWD}/libncurses.so.6 /usr/bin/ffmpeg -hide_banner -nostats -loglevel error -i from.mp3 -y to.mp3
Segmentation fault
$ mv libncurses.so.6 libpthread.so.6
$ LD_PRELOAD=${PWD}/libpthread.so.6 /usr/bin/ffmpeg -hide_banner -nostats -loglevel error -i from.mp3 -y to.mp3
$

This was not a problem in the past because cairo linked in libEGL.so which would pull in libpthread.so but x11-libs/cairo-1.17.6-r1 removed opengl support so did not need libEGL.so.

When run in gdb no wrapper is inserted around pthread_create so all is OK, I suspect that it detects the tracing using TracerPid in /proc/self/status
Code:

$ strings -a /usr/lib64/opengl/nvidia/lib/libGL.so.340.108  | grep -P "TracerPid|libpthread|status"
/proc/self/status
libpthread.so.0
;/proc/self/status
TracerPid:
libpthread.so

and then hides what it would do when not traced, the same would be true for strace - it is a proprietary driver.

Currently I am using wrapper scripts for the preload but using patchelf to add libpthread.so as a dependancy to libGL.so may be better approach i.e.
Code:

$ cp /usr/lib64/opengl/nvidia/lib/libGL.so.340.108 .
$ LD_PRELOAD=${PWD}/libGL.so.340.108 /usr/bin/ffmpeg -hide_banner -nostats -loglevel error -i from.mp3 -y to.mp3
Segmentation fault
$ patchelf --add-needed libpthread.so.0 libGL.so.340.108
$ LD_PRELOAD=${PWD}/libGL.so.340.108 /usr/bin/ffmpeg -hide_banner -nostats -loglevel error -i from.mp3 -y to.mp3
$


Mark
Back to top
View user's profile Send private message
molletts
Tux's lil' helper
Tux's lil' helper


Joined: 16 Feb 2013
Posts: 119

PostPosted: Mon Jun 26, 2023 5:11 pm    Post subject: Reply with quote

Geneslaf wrote:

Currently I am using wrapper scripts for the preload but using patchelf to add libpthread.so as a dependancy to libGL.so may be better approach i.e.
Code:
...
$ patchelf --add-needed libpthread.so.0 libGL.so.340.108
...



Thanks for that! I've been able to switch my #2 PC (at my parents' place) back from Nouveau to the Nvidia 340.108 driver. Nouveau was good enough most of the time, with manual reclocking when needed, but the lack of GL threading caused problems for some applications (most recently causing SDDM to hang at a black screen and log DMA_PUSHER errors in dmesg, requiring me to restart it from the text console one or more times) and its memory management wasn't great - the card would run out of VRAM after gaming for a while, requiring a reboot to recover.

KDE (and everything else) now runs perfectly and I can, hopefully, nurse a little more life out of my perfectly-good fully-working GTX260. I guess eventually I'll upgrade my main PC to a Radeon, move the GTX460 down from it and repeat the process until that either dies or the 390.x drivers become impossible to maintain.

I've used a portage post-install hook to automatically patch both the 64- and 32-bit libGL.so.340.108 in case x11-drivers/nvidia-drivers gets rebuilt for any reason.
Back to top
View user's profile Send private message
nuku97
n00b
n00b


Joined: 14 Apr 2023
Posts: 3

PostPosted: Wed Jul 12, 2023 9:28 pm    Post subject: Reply with quote

Thank you for sharing the patchelf command! This also worked for me and my KDE desktop runs fine again on this old notebook from 2009!
[/code]
Back to top
View user's profile Send private message
Shibotto
Apprentice
Apprentice


Joined: 19 Jun 2015
Posts: 156
Location: CET/CEST

PostPosted: Tue Dec 26, 2023 11:08 pm    Post subject: Reply with quote

Long time no see folks, let me cut straight to the important stuff:

  • I've been using and testing the AUR patches for a couple of weeks and everything seems OK with 5.10, 5.15, 6.1 and 6.6. I'm dropping the kernel config checks though, because I've never actually checked them (I'm a -bin user) and they are most likely wrong/obsolete. If anyone can make a comprehensive list spanning at least the 4 kernel versions mentioned above, I will gladly include it.

  • Thank you so much for the patchelf solution, I will do that directly in the ebuild.

ETA this week, barring unforeseen circumstances.


↓↓↓ Chatting time (aka you don't have to read this) ↓↓↓

So, it's been 2 years. Did my old Nvidia hardware die? Was I too busy to take care of this overlay? None of the above, I just... didn't strictly need to. After all my goal from the very beginning was to set it up in a way that it would very hardly ever conflict with whatever might happen in Gentoo, so I sat comfortably on 5.15 and kept upgrading the rest of the distro without a worry in the world. And that's the end of the happy, "mission accomplished" part of this story.

At the same time, I've been very disheartened by the maintenance struggle kernel developers are facing with LTS versions. LTS' are vital for us, because any kernel at any given time could be the end of the line, the last one which this relic of a driver could be reasonably adapted to. So when I look at the right column of the longterm table and see a pile of "Dec, 2026"... why should I even bother with newer kernels?

What changed then? For starters, linux-mod.eclass got deprecated. It will probably still be there for quite some time, but I don't like sitting on a time bomb (well, not another one) waiting for portage to fail on me. We have a new eclass of course and it even has a quick migration guide to make the transition super simple. As always, many, many thanks to Ionen for the hard work. The other reason is that since Gentoo only supports < 3 years old kernels (except for vanilla-sources), as a gentoo-kernel-bin user I only have 1 year left of 5.15. I'm already missing when "Dec, 2026" sounded bad. So now was a good time to get this moving again.

Oh, and the Qt issue. I can't make any excuses here: I've been aware of the problem since around mid 2022, but because I didn't know of a proper solution I've never brought it up. I've spent a lot of time on that though. First I tried debugging, but what I got didn't ring any bell at the moment. So I did the only next obvious thing: install another Gentoo and upgrade it until the problem shows up again. Ionen, if you remember seeing me hunting for a 4 months old or so stage3 on IRC around last December, now you know what I was doing :P . It took a long time, but if I remember correctly the trigger on my system was libpcre2 which stopped linking directly to libpthread, the only component which was bringing libpthread in the chain of dependencies of every Qt programs. After that the LD_PRELOAD workaround was obvious, but that's as far as my knowledge of libraries goes. I didn't know about patchelf and I still really don't; the sad thing is that if I mentioned this here I would have been able to fix this months ago. My bad.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3267
Location: Canada

PostPosted: Wed Dec 27, 2023 1:55 am    Post subject: Reply with quote

Well, that 3 year limit on LTS kernels from gentoo is a bummer. When you build a server, it's lifetime is usually more that 3 years, and during its life you do not what to play with kernel upgrades much. It is funny if may older nvidia-340 computer will get the newest kernel among all my machines as the result (they all stuck at 4.19)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
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