Selecting different video driver @ boot, 10.04

More
04 Dec 2010 22:07 #5862 by rogma
Hi,

I have not a specific computer for EMC and have felt the need for being able to boot with different video drivers depending on what I'm doing. I'm have a 30' monitor and a Nvidia video card and wanted the full resolution when surfing the web and running CAD/CAM applications, but still be able to run EMC from the same computer.

Ubuntu 10.04
EMC 2.4.6
NVIDIA GeForce 8800 GTS

Maybe there are better ways to do this, but this is what I did:
  1. A realtime kernel, 2.6.32-122-rtai, exist for EMC and can be chosen at boot with GRUB2.
  2. A generic kernel, 2.6.32-26-generic-pae, exist for normal use and can be chosen at boot with GRUB2.
  3. Installing Nvidia drivers from a generic kernel run to get large video resolution.
  4. Nvidia created file xorg.conf and I copied it to /etc/X11/xorg.conf.nvidia.
  5. Copied the above file to /etc/X11/xorg.conf.nv and made some changes. Video Driver was changed to use nv. ModulePath was added for X not to load Nvidia stuff.
  6. Created file /etc/init.d/VideoDriverSelect.sh. This file selects which xorg.conf to use.
  7. Made it executable and run at boot.
    sudo chmod +x VideoDriverSelect.sh
    sudo update-rc.d VideoDriverSelect.sh defaults 10
  8. Changed /usr/bin/emc to not dynamically link nvidia libraries.
    if test "xyes" = "xno"; then
    	if [ -z "$LD_LIBRARY_PATH" ]; then
    	    LD_LIBRARY_PATH=$EMC2_HOME/lib
    	else
    	    LD_LIBRARY_PATH=$EMC2_HOME/lib:"$LD_LIBRARY_PATH"
    	fi
    	export LD_LIBRARY_PATH
    fi
  9. to
if test "xyes" = "xyes"; then
	if [ -z "$LD_LIBRARY_PATH" ]; then
	    LD_LIBRARY_PATH=/usr/lib/mesa/:$EMC2_HOME/lib
	else
	    LD_LIBRARY_PATH=/usr/lib/mesa/:$EMC2_HOME/lib:"$LD_LIBRARY_PATH"
	fi
	export LD_LIBRARY_PATH
fi
[/li]


/etc/init.d/VideoDriverSelect.sh
#!/bin/sh
if grep -q -e -rtai /proc/version
then
        cp -lf /etc/X11/xorg.conf.nv /etc/X11/xorg.conf
else
        cp -lf /etc/X11/xorg.conf.nvidia /etc/X11/xorg.conf
fi

xorg.conf.nvidia
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 1.0  (buildmeister@builder75)  Thu Apr 22 11:44:23 PD
T 2010
.
.
.


Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection


xorg.conf.nv
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 1.0  (buildmeister@builder75)  Thu Apr 22 11:44:23 PD
T 2010
.
.
.

Section "Files"
    ModulePath	   "/usr/lib/xorg/modules"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nv"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Please Log in or Create an account to join the conversation.

Time to create page: 0.069 seconds
Powered by Kunena Forum