LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   Problem : 2 Graphic Cards !!!! (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/problem-2-graphic-cards-563966/)

Veskit 06-23-2007 11:17 AM

Problem : 2 Graphic Cards !!!!
 
Hello,

I've just installed Ubuntu Feisty (amd64) on my vaio SZ4, and of course I want to make both graphic cards work (INTEL GMA 950 an Geforce 7400 Go)
I've found some explanation on how to make a "xorg-switcher"

1) I've installed Feisty with intel GMA 950 all is working great (3D, beryl ....)

2) Then I wanted to install NVIDIA 7400, everything is great with nvidia drivers, my xorg.conf is edited and all is working (3D, beryl ...)

3)I'm preparing the xorg-switcher having a xorg.conf.stamina (for intel GMA) and xorg.conf.speed (for nvidia). I'm creating a xorg switcher

Quote:

#!/bin/bash
#switch xorg

VIDEO=`/usr/bin/lspci |grep -c nVidia`

if [ "$VIDEO" = 1 ]; then
cp -f /etc/X11/xorg.conf.speed /etc/X11/xorg.conf
else
cp -f /etc/X11/xorg.conf.stamina /etc/X11/xorg.conf
fi
then
# chmod +x /etc/init.d/xorg-switcher
# ln -s /etc/init.d/xorg-switcher /etc/rc2.d/S12xorg-switcher
ok the switcher is working great my 2 cards are working

BUT ! when I switch to the intel GMA and check for "direct rendering" I have

Quote:

$ glxinfo | grep direct

Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ": 0.0".
Error: couldn't find RGB GLX visual
Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ": 0.0".
Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ":0.0 ".
Installing NVIDIA drivers have removed "direct rendering" for intel GMA

can someone help me with that ? I've lost 3D acc on intel GMA and can't use beryl

I'm a big newb on ubuntu I've just starded....

Recently I've just found this:here

and after making a :
libglx.so.stamina, and libglx.so.1.stamina
(when intel GMA was working in phase 1))

libglx.so.speed, and libglx.so.1.speed
(when Geforce 7400 was working in phase 2))

I edited my xorg-switcher

Quote:

#!/bin/bash
#switch xorg

VIDEO=`/usr/bin/lspci |grep -c nVidia`

if [ "$VIDEO" = 1 ]; then
cp -f /etc/X11/xorg.conf-speed /etc/X11/xorg.conf
modprobe drm
modprobe nvidia-agp
rm /usr/lib/xorg/modules/extensions/libglx.so /usr/lib/libGL.so -f
ln -s /usr/lib/xorg/modules/extensions/libglx.so.speed /usr/lib/xorg/modules/extensions/libglx.so
ln -s /usr/lib/libGL.so.1.speed /usr/lib/libGL.so.1
else
modprobe intel-agp
cp -f /etc/X11/xorg.conf-stamina /etc/X11/xorg.conf
rm /usr/lib/xorg/modules/extensions/libglx.so /usr/lib/libGL.so -f
ln -s /usr/lib/xorg/modules/extensions/libglx.so.stamina /usr/lib/xorg/modules/extensions/libglx.so
ln -s /usr/lib/libGL.so.1.stamina /usr/lib/libGL.so.1

fi
But it's still not working plz if someone can help me, It's been 4 days that I'm spending days and nights to fix this problem and I think i'm getting pretty close...

Thanks a lot

Veskit

if you find an answer plz email me : takayanagi_masataka@hotmail.com :(

PTrenholme 06-23-2007 11:55 AM

I don't know about Ubuntu, but when the nVidia drivers are installed on a Fedora system from the nVidia driver script, the X11 rendering library is replaced by a "better" one from nVidia. Unfortunately, this "better" library is not compatible with other manufacturer's X11 library usage.

If this is the cause of your problem, you'll need to have your "switcher" also switch the library, and prevent pre-linking X.org.

Veskit 06-24-2007 05:56 AM

Quote:

Originally Posted by PTrenholme
I don't know about Ubuntu, but when the nVidia drivers are installed on a Fedora system from the nVidia driver script, the X11 rendering library is replaced by a "better" one from nVidia. Unfortunately, this "better" library is not compatible with other manufacturer's X11 library usage.

If this is the cause of your problem, you'll need to have your "switcher" also switch the library, and prevent pre-linking X.org.

Ok, and do you know where I can find those libs ? I mean, it's just switching 2 files but I really don't know where they can be.

/usr/lib/libGL.so and /usr/lib/xorg/modules/extensions/libglx.so are not enough ?

Thanks,

Veskit

PTrenholme 06-24-2007 12:10 PM

Sorry, no. Being lazy, I just use the RPMs from livna built for Fedora systems. You might find the information you want in the "sticky" note at the top of the Fedora forum where the problem is described, with links to some discussions.

Perhaps you can identify which (if any) xorg libraries were modified by looking for "unexpected" creation or modification dates on the library files.

Remember, though, that I don't even know if what I described actually applies to your system.

Too get the "original" libraries, it might be simplest to boot to level 3, uninstall the Xorg stuff, and reinstall it (being careful to not uninstall dependencies (like, for example, all you graphic application)). If Ubuntu has tools like apt or smart for managing software, perhaps a simple "repair" operation might set things right. (Note: Foregoing is speculation, and not recommendation for action until you have verified that it will solve your problem. Also, a good, complete, backup of your system before messing around might be a good thing® to have available.)

kstan 06-26-2007 03:20 AM

Like PTrenholme mentioned, your pc will use nvidia opengl library even thought currently use intel(Easy to say that, they conflict!). So, the way I recommend use another kind of method to install/reinstall display driver before startx.

probably you can use a script in /etc/init.d/rc.local to perform this job:-
Quote:

#/bin/bash
BRAND=`lspci | grep "VGA" | awk '{print $5}'`
if [ $BRAND eq 'nVIDIA']
step to reinstall/reconfigure your nvidia driver
else
step to remove nvidia driver
step to reinstall your intel driver

fi

Since you did configure display driver properly for nvidia before, then I assume you get what i mean.
*Please reply us how you do this.

Regards,
Ks

Veskit 06-26-2007 03:53 AM

Quote:

Originally Posted by kstan
Like PTrenholme mentioned, your pc will use nvidia opengl library even thought currently use intel(Easy to say that, they conflict!). So, the way I recommend use another kind of method to install/reinstall display driver before startx.

probably you can use a script in /etc/init.d/rc.local to perform this job:-


Since you did configure display driver properly for nvidia before, then I assume you get what i mean.
*Please reply us how you do this.

Regards,
Ks

First of all thanks PTrenholme and kstan for your help. After one week of research I finally found GLX libs and manage to adapt the switcher script. Day by Day I'm getting more used to Linux (especially Ubuntu)

I can't post the script atm because I'm at work but basically it's even more simple than "desinstall/reinstall", all you have to do is :

if nvidia then
replace xorg.conf by xorg.conf.nvidia
remove GLX intel
similink of GLX nvidia (2 files to replace)
else
replace xorg.conf by xorg.conf.intel
remove GLX nvidia
similink of GLX intel (2 files to replace)

the point that I missed is that the 2 GLX libs are not at the same place if it's nvidia or intel

intel libglx.so is in /usr/lib/xorg/extension/modules
and nvidia one is in /usr/lib/xorg/extension

so you musn't mess with the path (which I did :p)

Everything is ok now !

Thanks a lot for your support and fast replies

Veskit

PTrenholme 06-27-2007 04:07 PM

<edit>
I was thinking about what you'd written above, and it struck we that just redefining the syslinks might be (slightly) more efficient.

Here's some (untested) code that might do that for xorg.conf, and (if it does), the library symlink changes could easily be added. Please note the "untested" comment.
Code:

#!/bin/bash
#
# Switch xorg.conf to an alternative conf file:
#
# Note: If this script is not run with "root" privelages,
#      the user running it must have permission to run
#      commands set in /etc/sudoers
#
#-----------------
#
# Save the current directory location and move to /etc/X11
#
pushd /etc/X11/ > /dev/null
#
# Verify that the current xorg.conf is a symlink, and save it if it's not
#
# Note that, for example, installing a new device, may result in a new xorg.conf being created.
if ! [ -h xorg.conf ]
then
    sudo mv -b xorg.conf xorg.conf.save
    sudo ln -s xorg.conf.save xorg.conf
fi
#
# Identify the desired new conf file
#
# This section assumes that all alternate conf files are named xorg.conf.name
# If another convention is used, you will need to change this section.
#
type=""
let count=0
for file_name in `ls xorg.conf*`
do
    ext=$(echo $file_name | cut -f 3 -d '.')
#  Check for an extension name
    if [ -z $ext ]
    then
#      No extension found.
        continue
    else
#      Found one, increment the count and add it to the list
        let count=++count
        type="$type $ext"
    fi
done
# Did we find any alternatives?
if [ $count -eq 0 ]
then
    echo No alternative configuration files were found in $(pwd).
    popd > /dev/null
    exit 0
fi
# Found some. Get the name of the one to use.
if [ $count -gt 0 ]; then
    echo Enter the number corresponding to the configuration you want to load.
    select conf in $type
    do
      if [ -z conf ];
      then
          echo No changes made. >> /dev/stderr
          popd > /dev/null
          exit 1
      else
          target=$conf
          break
      fi
    done
else
# We should never get here (count would have to be negative)
    echo Impossible condition: count=$count which is less than 0. Aborting. >>/dev/stderr
    popd > /dev/null
    exit 2
fi
#
# O.K., we're changing to $target (if we've got a target)
#
if ! [ -z $target ] # This should always be true
then
    sudo rm xorg.conf
    sudo ln -s xorg.conf.$target xorg.conf
else
# But, in case it isn't . . .
    echo No new configuration file was selected. >> /dev/stderr
fi
#
# All done. Reset the working directory and exit.
#
popd > /dev/null

</edit>

Not a question you asked, but the livna solution (of linking nVidia to it's own library set with "non-standard" names) lets you actually use an nVidia card and another vendor's card at the same time. (On different monitors, of course.)

So, if you want the "real linux experience", you can set up a media wall with several monitors and drive them all off of one box, using different cards. Most "modern" cards support two different monitors, so, with five boards you could run a 3 x 3 screen array.

Just a thought . . . (And, no, I've never tried it. You need more money than I have to play in that league.)

kstan 06-27-2007 07:24 PM

Quote:

Originally Posted by Veskit
First of all thanks PTrenholme and kstan for your help. After one week of research I finally found GLX libs and manage to adapt the switcher script. Day by Day I'm getting more used to Linux (especially Ubuntu)

I can't post the script atm because I'm at work but basically it's even more simple than "desinstall/reinstall", all you have to do is :

if nvidia then
replace xorg.conf by xorg.conf.nvidia
remove GLX intel
similink of GLX nvidia (2 files to replace)
else
replace xorg.conf by xorg.conf.intel
remove GLX nvidia
similink of GLX intel (2 files to replace)

the point that I missed is that the 2 GLX libs are not at the same place if it's nvidia or intel

intel libglx.so is in /usr/lib/xorg/extension/modules
and nvidia one is in /usr/lib/xorg/extension

so you musn't mess with the path (which I did :p)

Everything is ok now !

Thanks a lot for your support and fast replies

Veskit

Honestly speaking, I have same problem with you and I not yet fix it(Normally I run in speed mode).
:cry:

Veskit 06-29-2007 03:42 AM

:) PTrenholme I've tried to read 3 time your script but I guess i'm too nwb yet to test the "real Linux experience" :)
But since kstan have the same problem i'm gonna write a little "howto" (excuse my bad english and my newbiness)

First of all, you have to be in stamina mode with 3D rendering ok
(reinstall Intel driver is the fastest way if it's not working)

Backup the xorg.conf and the libs GLX, something like :

Quote:


# cp /etc/X11/xorg.conf /etc/X11/xorg.conf.stamina
# cp /usr/lib/xorg/modules/extensions/libglx.so /usr/lib/xorg/modules/extensions/libglx.so.stamina
# cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.stamina

Then install Nvidia drivers

Quote:


# apt-get install nvidia-glx-new
# nvidia-xconfig --composite --add-argb-glx-visuals -d 24

in your xorg.conf add 2 lines

Quote:


# gedit /ect/X11/xorg.conf

Section "Screen"
...
Option "TripleBuffer" "true"
Option "NoLogo" "true"
...
EndSection

Reboot and test nvidia 3D rendering

if it's ok, backup the nvidia xorg and GLX libs (I'm at work I don't remember exactly the name of the libglx.so)


Quote:


# cp /etc/X11/xorg.conf /etc/X11/xorg.conf.speed
# cp /usr/lib/xorg/modules/libglx.so.1.0.955 /usr/lib/xorg/modules/libglx.so.speed
# cp /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.speed

Now edit the xorg-switcher it should be something like :

Quote:


# switcher stamina / speed mode

VIDEO=`/usr/bin/lspci |grep -c nVidia`

if [ "$VIDEO" = 1 ]; then
cp -f /etc/X11/xorg.conf.speed /etc/X11/xorg.conf
modprobe drm
modprobe nvidia-agp
rm /usr/lib/xorg/modules/extensions/libglx.so /usr/lib/libGL.so.1 -f
ln -s /usr/lib/xorg/modules/libglx.so.speed /usr/lib/xorg/modules/libglx.so
ln -s /usr/lib/libGL.so.speed /usr/lib/libGL.so.1
else
cp -f /etc/X11/xorg.conf.stamina /etc/X11/xorg.conf
modprobe intel-agp
rm /usr/lib/xorg/modules/libglx.so /usr/lib/libGL.so.1 -f
ln -s /usr/lib/xorg/modules/extensions/libglx.so.stamina /usr/lib/xorg/modules/extensions/libglx.so
ln -s /usr/lib/libGL.so.stamina /usr/lib/libGL.so.1
fi


It should be ok

Veskit


All times are GMT -5. The time now is 07:32 PM.