Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Missing Nvidia devices
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
hollowsoul
n00b
n00b


Joined: 29 Feb 2004
Posts: 31

PostPosted: Mon Dec 19, 2005 4:33 pm    Post subject: Missing Nvidia devices Reply with quote

Have seen a couple of times now in irc.
So decided to make a post i can just send a link for the solution.

I think the problem with nvidia driver and newer kernel/udev
Not 100% sure why? If someone knows plz reply so i can find out for myself aswell :P


Step1 -- Check for missing nvidia devices
Code:
ls -l /dev/nvidia*

U should see /dev/nvidia0 and more, if not read on.



Step2 -- Check if u got the script
Code:
ls -l /sbin/NVmakedevices.sh

if u have this file u can skip step3


Step3 -- Get the nvidia device script
Copy the Code below into a file and save to /sbin/NVmakedevices.sh
Code:

#!/bin/sh

error() {
  echo "$(basename $0): fatal error, $1 failed"
  exit 1
}

# create a temporary file
tmp=`(mktemp -q /tmp/nvidia.XXXXXX) 2> /dev/null` || tmp="/tmp/nvidia.$$"


# The module-init-tools package uses different files and syntax than
# what was used previously used for 2.4 kernels: determine if this is
# a 2.6 or greater kernel, and then select the correct search path

kernel_2_6=""
[ `uname -r | cut -d '.' -f 2` -ge 6 ] && kernel_2_6="1"

paths_2_4="/etc/modutils/aliases /etc/modules.conf /etc/conf.modules"
paths_2_6="/etc/modprobe.d/aliases /etc/modprobe.conf"

[ "$kernel_2_6" ] && paths=$paths_2_6
[ "$kernel_2_6" ] || paths=$paths_2_4


# walk the search path, and select the first file that exists

modconf=""
for path in $paths; do
   if [ -f "$path" ]; then
       modconf=$path
       break
   fi
done


# if we found a file from the search path, update the nvidia alias

if [ ! -z $modconf ]; then
   # Initialize the permissions on $tmp so that we don't change the
   # permissions of $modconf when we mv it into place
   cp -p $modconf $tmp
   sed '/^alias.*\(NVdriver\|nvidia\)/d'  < $modconf   > $tmp
   
   # make sure the last character in the file is a newline
   [ `tail -n 1 $tmp | wc -l` = 0 ] && echo "" >> $tmp

   if [ -c /dev/.devfsd ]; then
     echo "alias /dev/nvidia*   nvidia" >> $tmp
   elif [ "$kernel_2_6" ]; then
     echo "alias char-major-195* nvidia" >> $tmp
   else
     echo "alias char-major-195 nvidia" >> $tmp
   fi
   mv -f $tmp $modconf
   test -x /sbin/update-modules && /sbin/update-modules
else
  if [ -f /etc/rc.d/rc.modules ]; then
    # Initialize the permissions on $tmp so that we don't change the
    # permissions of /etc/rc.d/rc.modules when we mv it into place
    cp -p /etc/rc.d/rc.modules $tmp
    sed '/.*\(NVdriver\|nvidia\).*/d' < /etc/rc.d/rc.modules > $tmp

    # make sure the last character in the file is a newline
    [ `tail -n 1 $tmp | wc -l` = 0 ] && echo "" >> $tmp

    echo "/sbin/modprobe nvidia" >> $tmp
    mv -f $tmp /etc/rc.d/rc.modules
  fi
fi

if [ ! -c /dev/.devfsd ]; then
  for i in 0 1 2 3 4 5 6 7; do
      node="/dev/nvidia$i"
      rm -f $node
      mknod $node c 195 $i || error "mknod \"$node\""
      chmod 0666 $node     || error "chmod \"$node\""
  done
  node="/dev/nvidiactl"
  rm -f $node       
  mknod $node c 195 255    || error "mknod \"$node\""
  chmod 0666 $node         || error "chmod \"$node\""
fi

exit 0


Then type
Code:
chmod 755 /sbin/NVmakedevices.sh


Step4 -- Add Script to start @ boot
Edit the /etc/conf.d/local.start
and add
Code:
if [ ! -e /dev/nvidia0 ]; then
  /sbin/NVmakedevices.sh
fi


Step5 -- Check it workin
Type
Code:
ls -l /dev/nvidia*


U should see more devices now :)


Restart xorg and u set to go
Back to top
View user's profile Send private message
iMike
Apprentice
Apprentice


Joined: 01 Apr 2005
Posts: 217
Location: Stockholm, Sweden

PostPosted: Tue Dec 27, 2005 10:56 pm    Post subject: Reply with quote

This thread also follows the top, in case you'd like another reference.

/iMike
Back to top
View user's profile Send private message
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Fri Jan 06, 2006 12:39 am    Post subject: Reply with quote

Moved from Desktop Environments to Duplicate Threads in favor of https://forums.gentoo.org/viewtopic-t-394817.html
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads 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