Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 02-22-07, 07:14 PM   #1
dmonty
Registered User
 
Join Date: Apr 2006
Posts: 3
Default Multiple video libraries.

How can I install the NVIDIA drivers and be able to switch back and forth between NVIDIA libraries and other graphics card libraries like mesa?

Background:
Our school district is implementing Debian Linux diskless clients in all the schools. We have chosen NVIDIA chipset for all new computers because it was the easiest to install and had the best 3d results for the end-users. The diskless clients nfs mount the same / partition which makes software updates super efficient. At bootup the workstations auto detect the video hardware and update the "Device"=>"Driver" section in xorg.conf

Problem:
The district had a donation of a thousand Asus ('via' video chipset) workstations. The NVIDIA installer overwrites libraries like libGL.so and libGLcore.so which causes the via chipset to loose its 3d acceleration. The NVIDIA installer is overwriting libraries provided by xorg and mesa.

Is there a way to install the nvidia drivers so that they do not overwrite default system libraries? Then at bootup I could write a script to switch back and forth between libraries based on the video chipset.
dmonty is offline   Reply With Quote
Old 02-22-07, 07:23 PM   #2
energyman76b
Registered User
 
Join Date: Dec 2002
Location: Clausthal/Germany
Posts: 1,104
Default Re: Multiple video libraries.

Well - gentoo can do it.

eselect opengl set nvidia switches to the nvidia libs
eselect opengl set xorg-x11 switches to mesa.

How?

well, the opengl libs are installed into /usr/lib/opengl/nvida and /usr/lib/opengl/xorg-x11 and in /usr/lib are symlinks of the libs which point to the 'right' implementation.
energyman76b is offline   Reply With Quote
Old 02-22-07, 07:44 PM   #3
dmonty
Registered User
 
Join Date: Apr 2006
Posts: 3
Default Re: Multiple video libraries.

Quote:
Originally Posted by energyman76b
well, the opengl libs are installed into /usr/lib/opengl/nvida and /usr/lib/opengl/xorg-x11 and in /usr/lib are symlinks of the libs which point to the 'right' implementation.
How does gentoo separate the modules? Which NVIDIA command line options do they use to get install in /usr/lib/opengl/nvidia ?

I'm not sure which nvidia install options to use to separate the libraries so the mesa ones do not get overwritten:
--x-prefix=
--x-module-path=
--x-library-path=
--opengl-prefix=
--opengl-libdir=

I could then symlink or bind mount the nvidia libraries on startup.
dmonty is offline   Reply With Quote
Old 02-22-07, 08:44 PM   #4
energyman76b
Registered User
 
Join Date: Dec 2002
Location: Clausthal/Germany
Posts: 1,104
Default Re: Multiple video libraries.

Quote:
Originally Posted by dmonty
How does gentoo separate the modules?
the same way.

Quote:
Originally Posted by dmonty
Which NVIDIA command line options do they use to get install in /usr/lib/opengl/nvidia ?
they don't use any command line options. The packet manager (portage) unpacks the driver package and copies the contents to the right places. The installer does nothing at all.

.
.
.
/usr/lib64/libXvMCNVIDIA.a
/usr/lib64/libXvMCNVIDIA.so -> /usr/lib64/libXvMCNVIDIA.so.1.0.9746
/usr/lib64/libXvMCNVIDIA.so.1.0.9746
/usr/lib64/opengl
/usr/lib64/opengl/nvidia
/usr/lib64/opengl/nvidia/extensions
/usr/lib64/opengl/nvidia/extensions/libglx.so
/usr/lib64/opengl/nvidia/extensions/libwfb.so
/usr/lib64/opengl/nvidia/include
/usr/lib64/opengl/nvidia/include/gl.h
/usr/lib64/opengl/nvidia/include/glext.h
/usr/lib64/opengl/nvidia/include/glx.h
/usr/lib64/opengl/nvidia/include/glxext.h
/usr/lib64/opengl/nvidia/lib
/usr/lib64/opengl/nvidia/lib/libGL.la
/usr/lib64/opengl/nvidia/lib/libGL.so -> libGL.so.1.0.9746
/usr/lib64/opengl/nvidia/lib/libGL.so.1 -> libGL.so.1.0.9746
/usr/lib64/opengl/nvidia/lib/libGL.so.1.0.9746
/usr/lib64/opengl/nvidia/lib/libGLcore.so -> libGLcore.so.1.0.9746
/usr/lib64/opengl/nvidia/lib/libGLcore.so.1 -> libGLcore.so.1.0.9746
/usr/lib64/opengl/nvidia/lib/libGLcore.so.1.0.9746
/usr/lib64/opengl/nvidia/lib/libnvidia-tls.so -> ../tls/libnvidia-tls.so
/usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.1 -> ../tls/libnvidia-tls.so.1
/usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.1.0.9746 -> ../tls/libnvidia-tls.so.1.0.9746
/usr/lib64/opengl/nvidia/no-tls
/usr/lib64/opengl/nvidia/no-tls/libnvidia-tls.so -> libnvidia-tls.so.1.0.9746
/usr/lib64/opengl/nvidia/no-tls/libnvidia-tls.so.1 -> libnvidia-tls.so.1.0.9746
/usr/lib64/opengl/nvidia/no-tls/libnvidia-tls.so.1.0.9746
/usr/lib64/opengl/nvidia/tls
/usr/lib64/opengl/nvidia/tls/libnvidia-tls.so -> libnvidia-tls.so.1.0.9746
/usr/lib64/opengl/nvidia/tls/libnvidia-tls.so.1 -> libnvidia-tls.so.1.0.9746
/usr/lib64/opengl/nvidia/tls/libnvidia-tls.so.1.0.9746
/usr/lib64/xorg
/usr/lib64/xorg/modules
/usr/lib64/xorg/modules/drivers
/usr/lib64/xorg/modules/drivers/nvidia_drv.so
.
.
.
energyman76b is offline   Reply With Quote
Old 02-26-07, 07:52 PM   #5
dmonty
Registered User
 
Join Date: Apr 2006
Posts: 3
Smile Re: Multiple video libraries.

Ok I was able to get it going on the Debian diskless clients. Here is the code used:

/usr/src/nvidia/build-command-client
Code:
#!/bin/sh
# Author: Dean Montgomery
# Date: Feb 23, 2007
# Param: $1 = is the nvidia driver file from nvidia.
# Desc: Extract the proprietary nvidia drivers and configure them whithout breaking other video driver libraries or Debian packages.

if [ "x" == "x$1" ]; then
  echo "You must supply a nvidia package name: $0 NVIDIA-Linux-x86-1.0-9631-pkg1.run"
  exit 1
fi
# extract package
sh $1 --extract-only
FOLDER=`echo $1 | awk -F '.run' '{print $1}'`
echo "Extracted to: $FOLDER";

# build kernel module
CDIR=`pwd`;
cd $FOLDER/usr/src/nv
make module
make install

# copy nvidia driver files to the system.
cd $CDIR
rm -fr /usr/local/nvidia.bak
mv /usr/local/nvidia /usr/local/nvidia.bak
mv $FOLDER/usr /usr/local/nvidia

# copy bin files
cd /usr/local/nvidia/bin
cp -f nvidia-bug-report.sh nvidia-settings nvidia-xconfig /usr/local/bin/

# copy some driver files
cp -f /usr/local/nvidia/X11R6/lib/modules/drivers/nvidia_drv.so /usr/lib/xorg/modules/drivers/

# create library symlinks
ldconfig -n /usr/local/nvidia/lib
ldconfig -n /usr/local/nvidia/lib/tls
ldconfig -n /usr/local/nvidia/X11R6/lib
ldconfig -n /usr/local/nvidia/X11R6/lib/modules
ldconfig -n /usr/local/nvidia/X11R6/lib/modules/drivers
ldconfig -n /usr/local/nvidia/X11R6/lib/modules/extensions
/etc/init.d/sd73-nvidia
Code:
#! /bin/sh
#
# Author:       Dean Montgomery
#
### BEGIN INIT INFO
# Provides:          sd73-nvidia
# Required-Start:    mountvirtfs $local_fs
# Required-Stop:     mountvirtfs $local_fs
# Default-Start:     S 2
# Default-Stop:      0 6
# Short-Description: Configure xorg libraries for nvidia.
# Description: Nvidia drivers break via and other chipsets. So we bind mount only if nessesary.
### END INIT INFO

#set -e
. /lib/lsb/init-functions

setup_nvidia(){
  grep Driver /etc/X11/xorg.conf | grep nvidia 1>/dev/null
  if [ "$?" == "0" ]; then
    domounts
  fi
}

domounts(){
  NV="/usr/local/nvidia"
  VERS=`ls /usr/local/nvidia/lib/libGL.so.*.* | awk -F 'libGL.so.' '{print $2}' | tr -d '\n'`
  # xorg
  mount --bind $NV/X11R6/lib/modules/extensions/libglx.so.$VERS /usr/lib/xorg/modules/extensions/libglx.so


  # /usr/lib handled by ldconfig or LD_LIBRARY_PATH
  #export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib/tls:/usr/local/nvidia/X11R6/lib:/usr/local/nvidia/X11R6/lib/modules:/usr/local/nvidia/X11R6/lib/modules/extensions:/usr/local/nvidia/X11R6/lib/modules/drivers
  mount --bind $NV/lib/libGL.la /usr/lib/libGL.la
  mount --bind $NV/lib/libGL.so.$VERS /usr/lib/libGL.so.1
  mount --bind $NV/lib/libGLcore.so.$VERS /usr/lib/libGLcore.so.1
  mount --bind $NV/lib/tls/libnvidia-tls.so.$VERS /usr/lib/libnvidia-tls.so.1
  mount --bind $NV/lib/libGLcore.so.$VERS /usr/lib/xorg/modules/extensions/libGLcore.so
}

remove_nvidia(){
  umount /usr/lib/xorg/modules/extensions/libglx.so
  umount /usr/lib/libGL.la
  umount /usr/lib/libGL.so.1
  umount /usr/lib/libGLcore.so.1
  umount /usr/lib/libnvidia-tls.so.1
  umount /usr/lib/xorg/modules/extensions/libGLcore.so
}

case "$1" in
  start)
        log_begin_msg "Checking for nvidia chipset..."
        setup_nvidia || true
        log_end_msg 0
        exit 0
        ;;
  stop)
        log_begin_msg "Stopping nvidia chipset"
        remove_nvidia || true
        log_end_msg 0;
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop}" >&2
        exit 1
        ;;
esac

exit 0
dmonty is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
IOGEAR 3D Complete+ 4-Port HDMI Switcher with 2D/3D Video Processor News Archived News Items 0 06-28-12 06:40 PM
Vivid Sydney in 3D, 2012 ' High Definition 3D Timelapse Video News Archived News Items 1 06-23-12 01:47 PM
Video: HPC Analyst Crossfire from ISC'12 News Archived News Items 0 06-23-12 01:00 AM
NVIDIA's Exclusive 3D Video with Doggfather of Hip-Hop News Archived News Items 0 06-13-12 07:30 PM
Best video card for running dual displays? nutsnbolts NVIDIA GeForce 7, 8, And 9 Series 10 09-03-02 03:02 PM

All times are GMT -5. The time now is 07:28 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.