← Back to team overview

sony-vaio-z-series team mailing list archive

Re: Better graphics card switching script

 

On Mi, 02 Sep 2009, Bernd Eggink wrote:
>> The nvidia installer? Hmm, never used that. Yes that can be a problem
>> so libGL.so.INTEL-LATEST is probably better
>
> No, that will be deleted as well. You really have to choose a name not  
> beginning with 'libGL.so'.

Unmpf thanks.


BTW, for DEBIAN (!!!) and probably Ubuntu I recommend the attached
script which is better in the sense that no copy of libGL.so.1.2 of
the intel driver has to be made.

The nvidia-glx package you should have installed will divert this lib
to /usr/lib/nvidia/ and this script links to that.

Best wishes

Norbert

-------------------------------------------------------------------------------
Dr. Norbert Preining <preining@xxxxxxxx>        Vienna University of Technology
Debian Developer <preining@xxxxxxxxxx>                         Debian TeX Group
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
`Er, hey Earthman...'
`Arthur,' said Arthur.
`Yeah, could you just sort of keep this robot with you and
guard this end of the passageway. OK?'
What from? You just said there's no
one here.'
`Yeah, well, just for safety, OK?' said Zaphod.
`Whose? Yours or mine?'
                 --- Arthur drawing the short straw on Magrathea.
                 --- Douglas Adams, The Hitchhikers Guide to the Galaxy
#!/bin/sh
lspci | grep -q "00:02.0"
# if we find the Intel chipset, use Intel drivers & settings
if [ $? -eq 0 ]; then
	logger "Setting graphics card to INTEL"
	cp /etc/X11/xorg.conf.INTEL /etc/X11/xorg.conf
	ln -sf /usr/lib/nvidia/libGL.so.1.2.xlibmesa /usr/lib/libGL.so.100000
	ln -sf /usr/lib/nvidia/libglx.so.xlibmesa /usr/lib/xorg/modules/extensions/libglx.so
	# this one saves a lot of energy!
	echo stamina > /sys/devices/platform/sony-laptop/speed_stamina
	# modprobe nvidia-control
else
	# otherwise use nVidia drivers & settings
	logger "Setting graphics card to NVIDIA"
	cp /etc/X11/xorg.conf.NVIDIA /etc/X11/xorg.conf
	ln -sf /usr/lib/libGL.so.185.18.36 /usr/lib/libGL.so.100000
	ln -sf /usr/lib/xorg/modules/extensions/libglx.so.185.18.36 /usr/lib/xorg/modules/extensions/libglx.so
	bash /etc/init.d/nvidia-glx start
	echo speed > /sys/devices/platform/sony-laptop/speed_stamina
fi
ln -sf /usr/lib/libGL.so.100000 /usr/lib/libGL.so.1


References