Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED!!!]Cant compile nvidia-drivers-260.19.36
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Tue Feb 08, 2011 2:56 am    Post subject: Reply with quote

emerge -uND world will bring in the latest kernel source regardless of usr/src/linux symlink
emerge --depclean will gut all but the latest kernel source removing the makefiles regardless of usr/src/linux symlink; without makefiles at /usr/src/linux nvidia-drivers will not build
for example, emerge =sys-kernel/gentoo-sources-2.6.36 will restore the 2.6.36 make files even though 2.6.36-r5 is the latest gentoo-sources, this would allow nvidia-drivers to build against 2.6.36 if /usr/src/linux points to 2.6.36
the depclean problem may be lyall's problem if he is a frequent depcleaner; I like moose's theory
_________________
Defund the FCC.
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1599
Location: Adelaide/Australia

PostPosted: Tue Feb 08, 2011 3:06 am    Post subject: Reply with quote

I think that I used
Code:
mount --bind /boot/src /usr/src
which effectively made the location the sources invisible, even to me, since the mount did not even show up in 'df'.
Even with this, the build did not work.
_________________
...Lyall
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1599
Location: Adelaide/Australia

PostPosted: Tue Feb 08, 2011 3:23 am    Post subject: Reply with quote

With regards to how I get the build to work,
I boot up another version of the kernel (typically 2.6.36-gentoo-r5)
Code:

eselect kernel set linux-2.6.36-gentoo-r5
# throw away every trace of the required kernel
emerge --unmerge gentoo-sources-2.6.35-r15
# Note the asterisk due to modules existing in /lib and /lib64, but not in /lib32
rm -fr /lib*/modules/2.6.35-gentoo-r15
# ditch directory that is left over
rm -fr /usr/src/linux-2.6.35-gentoo-r15
# obtain nice clean kernel sources
emerge =gentoo-sources-2.6.35-r15
eselect kernel set linux-2.6.35-gentoo-r15
cd /usr/src/linux
# nice fast build, with quad core, hyperthreading
make -j10 && make modules_install && make install
emerge nvidia-drivers
emerge virtualbox-modules
reboot

Now, I am able to rebuild the existing nvidia-drivers, until the next update.

I do use depclean but not often, this is a quite new install and depcleans have not been required very often, so far. Additionally, when I do depclean, I generally do a close examination of the list and do a revdep-rebuild -i afterwards, just to be sure.
_________________
...Lyall
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Tue Feb 08, 2011 3:40 am    Post subject: Reply with quote

revdep-rebuild will not restore make files removed by depclean, been there tried that, the error message is something like "missing rule to make nvidia-drivers".
you might try just
Code:
emerge =gentoo-sources-2.6.35-r15
without the preliminaries next time the problem occurs.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1599
Location: Adelaide/Australia

PostPosted: Tue Feb 08, 2011 3:50 am    Post subject: Reply with quote

Been there, tried that.
I wasn't able to build the nvidia-drivers until I got desperate and completely started the particular kernel version from scratch.
I tried make clean
I tried throwing the whole source tree away and starting again.
It wasn't until I blew the modules away and started the source tree from scratch, that the problem went away, till next time.
_________________
...Lyall
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6214
Location: Dallas area

PostPosted: Tue Feb 08, 2011 11:47 am    Post subject: Reply with quote

dwbowyer wrote:
For 6 months now, I've been getting this same problem with linux sources in /usr/src.
I can rebuild the existing nvidia-drivers, but not upgrade without first rebooting to another kernel.
My feeling has been that more recent nvidia-drivers are not respecting the /usr/src/linux symlink.



I've not had that problem, and I've run all the latest including the 270 series now.
_________________
UM780, 6.12 zen kernel, gcc 13, openrc, wayland
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6214
Location: Dallas area

PostPosted: Tue Feb 08, 2011 11:53 am    Post subject: Reply with quote

lyallp wrote:
With regards to how I get the build to work,
I boot up another version of the kernel (typically 2.6.36-gentoo-r5)
Code:

...
cd /usr/src/linux
# nice fast build, with quad core, hyperthreading
make -j10 && make modules_install && make install
emerge nvidia-drivers
emerge virtualbox-modules
reboot

Now, I am able to rebuild the existing nvidia-drivers, until the next update.


when you do the emerge nvidia-drivers are you doing it from within /usr/src/linux?
In other words, what is the difference between where you are when updating vs a complete kernel/nvidia rebuild?


And

are you doing a "modprobe -r nvidia" before you try and do any nvidia update?


Note: I always go back to the command line (stopping X) and modprobe -r nvidia before trying to update.
_________________
UM780, 6.12 zen kernel, gcc 13, openrc, wayland
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1599
Location: Adelaide/Australia

PostPosted: Tue Feb 08, 2011 12:05 pm    Post subject: Reply with quote

I do the emerge nvidia-drivers wherever, just like any other package, although, I am pretty sure I have failed in /usr/src/linux as well as elsewhere.
I don't do modprobe -r nvidia prior to emerging, I see no reason why that should be required.
I can understand unloading/reloading or rebooting to activate it, but not to compile it, as linux filesystems are not like NTFS, you can delete and re-create a file that is open, the inodes remain until the last accessor closes it, then the allocations are removed.
_________________
...Lyall
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6214
Location: Dallas area

PostPosted: Tue Feb 08, 2011 12:14 pm    Post subject: Reply with quote

lyallp wrote:
I do the emerge nvidia-drivers wherever, just like any other package, although, I am pretty sure I have failed in /usr/src/linux as well as elsewhere.
I don't do modprobe -r nvidia prior to emerging, I see no reason why that should be required.
I can understand unloading/reloading or rebooting to activate it, but not to compile it, as linux filesystems are not like NTFS, you can delete and re-create a file that is open, the inodes remain until the last accessor closes it, then the allocations are removed.


I'm aware that there shouldn't be a problem with compiling a newer driver while the old one is still in memory (modprobe)
but I have learned to err on the side of caution and I've avoided many of the problems that seem to crop up periodically for others.


The reason for all my questions is to try and find and differences between when it works and when it doesn't.
You absolutely should not have to completely remove all traces of the kernel source and modules before updating.

So if you remove a kernel source and all traces, and rebuild the nvidia drivers, can you then turn around an re-emerge the nvidia drivers or does that cause a problem also?


Edit to add:
And what does "ls -ld /lib/modules/*/video" and "ls -l /lib/modules/*/video" return
and what does "ls -l /usr/src/linux/Kbuild /usr/src/linux/Makefile" return
_________________
UM780, 6.12 zen kernel, gcc 13, openrc, wayland
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6214
Location: Dallas area

PostPosted: Tue Feb 08, 2011 2:02 pm    Post subject: Reply with quote

You get this
Code:
make -j8 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- LDFLAGS= IGNORE_CC_MISMATCH=yes V=1 SYSSRC=/usr/src/linux SYSOUT=/lib/modules/2.6.35-gentoo-r15/build HOST_CC=x86_64-pc-linux-gnu-gcc clean module
If you are using a Linux 2.4 kernel, please make sure
you either have configured kernel sources matching your
kernel or the correct set of kernel headers installed
on your system.

If you are using a Linux 2.6 kernel, please make sure
you have configured kernel sources matching your kernel
installed on your system. If you specified a separate
output directory using either the "KBUILD_OUTPUT" or
the "O" KBUILD parameter, make sure to specify this
directory with the SYSOUT environment variable or with
the equivalent nvidia-installer command line option.


Because of not being able to find "linux/version.h" or Makefile and .config

This is from the check that generates the above message with lots of stuff deleted for readability
Code:
    select_makefile)
        #
        # Select which Makefile to use based on the version of the
        # kernel we are building against: use the kbuild Makefile for
        # 2.6 and newer kernels, and the old Makefile for kernels older
        # than 2.6.
        #
        rm -f Makefile
        RET=1
        VERBOSE=$7
        FILE="linux/version.h"
        SELECTED_MAKEFILE=""

        if [ -f $HEADERS/$FILE -o -f $OUTPUT/include/$FILE ]; then
            #
            # We are either looking at a configured kernel source
            # tree or at headers shipped for a specific kernel.
            # Determine the kernel version using a compile check.
...
        else
            MAKEFILE=$HEADERS/../Makefile
            CONFIG=$HEADERS/../.config

            if [ -f $MAKEFILE -a -f $CONFIG ]; then
                #
                # This source tree is not configured, but includes
                # a Makefile and a .config file. If this is a 2.6
                # kernel older than 2.6.6, that's all we require to
                # build the module.
...
        if [ "$RET" = "0" ]; then
            ln -s $SELECTED_MAKEFILE Makefile
            exit 0
        else
            echo "If you are using a Linux 2.4 kernel, please make sure";



It looks for either /usr/include/linux/version.h or /usr/src/linux/include/linux/version.h
OR
it looks for a Makefile and .config file in /usr/src/linux
IF it can't find either then the message is generated.

Hope this helps
_________________
UM780, 6.12 zen kernel, gcc 13, openrc, wayland
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1599
Location: Adelaide/Australia

PostPosted: Wed Feb 09, 2011 2:24 am    Post subject: Reply with quote

ok, I thought it may be a permissions thing.
After all, I build using root.
I edit .config as root (either in an editor or using make menuconfig)
I emerge, which uses portage.
I have speculated, in the past, about ownership/permissions and one of my previous resolution attempts was to simply change ownership of the entire /usr/src/linux directory to portage.
Whilst this used to work in some cases, it seems not to now.
Code:
root@pearcely2 pearcely
# cd /usr/src
root@pearcely2 src
# ls -la linux/version.h
ls: cannot access linux/version.h: No such file or directory
root@pearcely2 src
root@pearcely2 src
# ls -la linux/*akefile linux/.config
-rw-r----- 1 root    root    74001 Feb  7 15:45 linux/.config
-rw-r--r-- 1 portage portage 51265 Jan 19 13:41 linux/Makefile
root@pearcely2 src
# cd linux
root@pearcely2 linux
# find . -name version.h -exec ls -la {} \;
-rw-r--r-- 1 portage portage 838 Aug  2  2010 ./arch/x86/math-emu/version.h
-rw-r--r-- 1 portage portage 1824 Aug  2  2010 ./drivers/net/cxgb3/version.h
-rw-r--r-- 1 portage portage 95 Aug  2  2010 ./fs/btrfs/version.h
-rw-r--r-- 1 portage portage 1016 Aug  2  2010 ./include/linux/dvb/version.h
-rw-rw-r-- 1 portage portage 97 Jan 19 13:50 ./include/linux/version.h
-rw-r--r-- 1 portage portage 87 Aug  2  2010 ./include/sound/version.h
-rw-r--r-- 1 portage portage 1654 Aug  2  2010 ./include/xen/interface/version.h
root@pearcely2 linux
#

I changed .config to have world read, no luck.
I tried ownership of .config to portage, still no luck.
_________________
...Lyall
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6214
Location: Dallas area

PostPosted: Wed Feb 09, 2011 2:42 am    Post subject: Reply with quote

On my system
Code:
-rw-r--r-- 1 root root 59009 Dec 29 12:42 /usr/src/linux/.config


I do emerges and kernel building as root.
_________________
UM780, 6.12 zen kernel, gcc 13, openrc, wayland
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1599
Location: Adelaide/Australia

PostPosted: Mon Feb 21, 2011 1:13 am    Post subject: Reply with quote

SOLVED !!!!!

My problem was that /usr/src directory was owned by root, user=rwx,group=rx,other=NOTHING

The actual /usr/src/linux-2.6.35-gentoo-r15 directory was world readable/executable, and obviously, so was the linux symlink.

I changed my /usr/src directory to be world read/execute and nvidia-drivers built!

(actually, in my case, /usr/src is a symlink to /boot/src, as described in earlier posts).

I also found my /lib/modules/2.6.??-gentoo-r? directory with the same user/group permissions. Fixing those to have world access helped.
_________________
...Lyall


Last edited by lyallp on Mon Apr 04, 2011 4:49 am; edited 1 time in total
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1599
Location: Adelaide/Australia

PostPosted: Thu Mar 24, 2011 5:36 am    Post subject: Reply with quote

Another Solved.

I found my /lib64/modules directory contained a 'build' and 'source' symlink and a 'kernel' directory, when they should be inside the 2.6.xx-gentoo-rx directory.

I blew those away and that also seemed to help!
_________________
...Lyall
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
Page 2 of 2

 
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