Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nvidia-drivers and gcc-9.x issues [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Mgiese
Veteran
Veteran


Joined: 23 Mar 2005
Posts: 1454
Location: indiana

PostPosted: Wed Nov 06, 2019 4:56 pm    Post subject: nvidia-drivers and gcc-9.x issues [solved] Reply with quote

hello,

when using gcc-9.1 or gcc-9.2, I have issues installing nvidia-drivers-440.31(as well as nvidia-drivers-435.21). using 8.x works well, any suggestions on this ?

Code:

cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/structleak_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/latent_entropy_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/randomize_layout_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/structleak_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/latent_entropy_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/randomize_layout_plugin.so
make[2]: *** [scripts/Makefile.build:281: /var/tmp/portage/x11-drivers/nvidia-drivers-440.31/work/kernel/nvidia/nv-frontend.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:281: /var/tmp/portage/x11-drivers/nvidia-drivers-440.31/work/kernel/nvidia/nv.o] Error 1
cc1: error: incompatible gcc/plugin versions
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/structleak_plugin.so
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/structleak_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/latent_entropy_plugin.so
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/latent_entropy_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/randomize_layout_plugin.so
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/randomize_layout_plugin.so
make[2]: *** [scripts/Makefile.build:281: /var/tmp/portage/x11-drivers/nvidia-drivers-440.31/work/kernel/nvidia/nv-pci.o] Error 1
make[2]: *** [scripts/Makefile.build:281: /var/tmp/portage/x11-drivers/nvidia-drivers-440.31/work/kernel/nvidia/nv-acpi.o] Error 1
make[1]: *** [Makefile:1626: _module_/var/tmp/portage/x11-drivers/nvidia-drivers-440.31/work/kernel] Error 2
make[1]: Leaving directory '/usr/src/linux-5.3.6-gentoo-r1'
make: *** [Makefile:81: modules] Error 2


thanks a lot
_________________
I do not have a Superman complex, for I am God not Superman :D


Last edited by Mgiese on Fri Nov 15, 2019 4:06 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14957

PostPosted: Thu Nov 07, 2019 2:19 am    Post subject: Reply with quote

For what gcc are those plugins built? It looks to me like you built the kernel with one version of gcc, then tried to build the drivers with a different version of gcc. Even if you got past the plugin problems, this likely won't work, since the kernel normally requires you to use the same version of gcc for the core kernel and for the modules.
Back to top
View user's profile Send private message
OldTango
l33t
l33t


Joined: 21 Feb 2004
Posts: 628

PostPosted: Sat Nov 09, 2019 11:29 pm    Post subject: Reply with quote

Hu wrote:
For what gcc are those plugins built? It looks to me like you built the kernel with one version of gcc, then tried to build the drivers with a different version of gcc. Even if you got past the plugin problems, this likely won't work, since the kernel normally requires you to use the same version of gcc for the core kernel and for the modules.
Are you sure about this? I know the nvidia-drivers have to be built against the kernel you intend to run or they won't load, but I have never heard that gcc could pose a problem. I believe the nvidia package uses /usr/src/linux by default for the kernel it builds against.
Code:
uname -a
Linux SuperTux 4.16.5-gentoo #6 SMP Tue May 15 11:12:26 MDT 2018 x86_64 AMD Ryzen Threadripper 1950X 16-Core Processor AuthenticAMD GNU/Linux
As you can see the kernel I am running was built over a year ago and I believe it was built with ether the 6x or 7x versions of gcc. I have updated and ran at least one version of gcc and several updates to the nvidia-drivers packages as well without a single issue using this kernel, (yet).

Tango..... :?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14957

PostPosted: Sun Nov 10, 2019 1:42 am    Post subject: Reply with quote

I was certain when I wrote that, but I checked the sources before answering now and I see that I was wrong. The version magic requires matching kernel release (UTS), SMP, PREEMPT, MODULE_UNLOAD, MODVERSIONS, architecture vermagic, and randstruct. Notably absent from this list is gcc version. Therefore, you are correct: you can use different gcc versions for the core kernel and modules, and the kernel will not complain. Whether it is guaranteed to work correctly is an entirely separate question. :)

Since OP has enabled randstruct, he will need matching randstruct configurations between core kernel and modules, and to get that, he will need to get the randstruct plugin to work. The easiest way to do that would be to use the same gcc version everywhere. While my advice to match gcc versions was based on a faulty recollection, it still would solve a problem that needs to be solved. ;)

Also, I should point out that you really ought to upgrade. A kernel more than a year out of date is missing numerous security patches, and that series has long since been discontinued.
Back to top
View user's profile Send private message
OldTango
l33t
l33t


Joined: 21 Feb 2004
Posts: 628

PostPosted: Sun Nov 10, 2019 3:28 am    Post subject: Reply with quote

Hu wrote:
I was certain when I wrote that, but I checked the sources before answering now and I see that I was wrong. The version magic requires matching kernel release (UTS), SMP, PREEMPT, MODULE_UNLOAD, MODVERSIONS, architecture vermagic, and randstruct. Notably absent from this list is gcc version. Therefore, you are correct: you can use different gcc versions for the core kernel and modules, and the kernel will not complain. Whether it is guaranteed to work correctly is an entirely separate question. :)
I can't say you were wrong because the Nvidia docs do state
Quote:
You appear to be compiling the NVIDIA kernel module with
a compiler different from the one that was used to compile
the running kernel. This may be perfectly fine, but there
are cases where this can lead to unexpected behavior and
system crashes.

If you know what you are doing and want to override this
check, you can do so by setting IGNORE_CC_MISMATCH.

In any other case, set the CC environment variable to the
name of the compiler that was used to compile the kernel.

You should compile the NVIDIA kernel module with the same compiler version
that was used to compile your kernel. Some Linux kernel data structures are
dependent on the version of gcc used to compile it
All of the nvidia-driver packages in portage set "IGNORE_CC_MISMATCH" and should suppress all gcc mismatch errors, but as you say there is no guarantee this will work right if at all.

Hu wrote:
Since OP has enabled randstruct, he will need matching randstruct configurations between core kernel and modules, and to get that, he will need to get the randstruct plugin to work. The easiest way to do that would be to use the same gcc version everywhere. While my advice to match gcc versions was based on a faulty recollection, it still would solve a problem that needs to be solved. ;)
Seems like sound advise to me.... :)

Hu wrote:
Also, I should point out that you really ought to upgrade. A kernel more than a year out of date is missing numerous security patches, and that series has long since been discontinued.
Again good advise. I put this kernel together reluctantly but at the time it was the only one in portage that provided the necessary drivers and support for my hardware and even the stable version of gcc at the time didn't provide good support for my processor. Once gentoo-sources-4.19.82 is stable (soon now) I will be installing it.

Tango..... :)
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7368

PostPosted: Sun Nov 10, 2019 3:23 pm    Post subject: Reply with quote

i think you have more an issue with the gcc modules, everything i have is older, and fine
Code:
strings /lib/modules/4.14.67/video/nvidia.ko | grep "gcc\|version\="
gcc version 9.2.0 (Gentoo 9.2.0 p1)
version=435.17
srcversion=69532EC3A412554E1395430
Back to top
View user's profile Send private message
Mgiese
Veteran
Veteran


Joined: 23 Mar 2005
Posts: 1454
Location: indiana

PostPosted: Thu Nov 14, 2019 11:50 pm    Post subject: Reply with quote

thanks for the replies! is there a way to find out with which gcc the kernel has been build ?

and is it sufficient to do "make menuconfig all" and then exit , to build with the new gcc version (after gcc-config x) ? or is it necessary to do a "make clean" ?
_________________
I do not have a Superman complex, for I am God not Superman :D
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7501
Location: Saint Amant, Acadiana

PostPosted: Fri Nov 15, 2019 12:51 am    Post subject: Reply with quote

You do 'make clean' and 'make' and 'make modules_install', nothing else.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Mgiese
Veteran
Veteran


Joined: 23 Mar 2005
Posts: 1454
Location: indiana

PostPosted: Fri Nov 15, 2019 1:08 am    Post subject: Reply with quote

Jaglover wrote:
You do 'make clean' and 'make' and 'make modules_install', nothing else.


it looked as if the whole kernel was rebuild after switching to gcc-9.2. i did not do clean or modules_install.... nvidia-drivers-440.31 compile fine now....
_________________
I do not have a Superman complex, for I am God not Superman :D
Back to top
View user's profile Send private message
OldTango
l33t
l33t


Joined: 21 Feb 2004
Posts: 628

PostPosted: Fri Nov 15, 2019 1:31 am    Post subject: Reply with quote

Mgiese wrote:
thanks for the replies! is there a way to find out with which gcc the kernel has been build ?


Code:
uname -a
Will tell you what kernel your booted into. If you have more than one kernel that you can boot, be careful that you KNOW which kernel is booted.
Code:
eselect gcc list
Will tell you what versions of gcc you have and if more than one which one is currently active.

If you running a later kernel find it's .config file and have a look. Near the very top should be a line telling you what complier was used to build the kernel. Here is the info from my recent .config.
Code:
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.19.82-gentoo Kernel Configuration
#

#
# Compiler: gcc (Gentoo 9.2.0-r2 p3) 9.2.0


Best Tango


Last edited by OldTango on Fri Nov 15, 2019 1:37 am; edited 1 time in total
Back to top
View user's profile Send private message
OldTango
l33t
l33t


Joined: 21 Feb 2004
Posts: 628

PostPosted: Fri Nov 15, 2019 1:33 am    Post subject: Reply with quote

A little late with my help I see. Glad you got it fixed. Remember to mark this subject as SOLVED.

Best Tango
Back to top
View user's profile Send private message
Mgiese
Veteran
Veteran


Joined: 23 Mar 2005
Posts: 1454
Location: indiana

PostPosted: Fri Nov 15, 2019 4:06 pm    Post subject: Reply with quote

OldTango wrote:
A little late with my help I see. Glad you got it fixed. Remember to mark this subject as SOLVED.

Best Tango


i`ll do. thanks a lot !
_________________
I do not have a Superman complex, for I am God not Superman :D
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
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