You are not logged in.

#1 2009-08-22 09:04:07

lisa860
Member
Registered: 2009-08-22
Posts: 2

How to switch between Video drivers?

I have arch in my external USB HDD. I've got nvidia card in my laptop. I use arch mainly in my laptop and have configured  X using nvidia driver. How do I change the driver to intel as when I connect it to my PC [which has an intel card] so that the graphics look proper. I have the downloaded xf86-video-intel driver in pcman cache. Do I need to completely uninstall nvidia and install intel everytime?

Offline

#2 2009-08-22 10:31:22

jelly
Administrator
From: /dev/null
Registered: 2008-06-10
Posts: 714

Re: How to switch between Video drivers?

you could try making two xorg.conf 's one for nvidia and one for intel

Offline

#3 2009-08-22 11:13:22

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: How to switch between Video drivers?

Since nvidia ships their own libgl that conflicts with the stock libgl used by the intel driver, having both packages installed side by side is not easily possible.

You should be able to automate switching the video drivers using pacman, probably using a method similar to this:

Warning:
This is unchecked pseudo-code, you need to carefully adjust this to your situation. pacman may need some more/different switches.

e.g, in your rc.local:

# check if lspci shows your nvidia card (or find some other method of 
# finding out on which box you are):
# For my box i'd use my cards model name...

if (lspci | grep GeForce4 &> /dev/null); then # we're on the nvidia machine
  # remove libgl
  pacman --noconfirm -R libgl
  
  # install nvidia driver
  pacman -U /path/to/your/nvidia/driver/package
  
  # adjust xorg.conf symlink
  ln -sf /etc/X11/xorg.conf-nvidia /etc/X11/xorg.conf

else # assume we're on the intel machine
  
  # remove the nvidia package
  pacman -R nvidia-96xx
  
  # install the stock libgl and intel driver
  pacman -U /path/to/libgl/package
  pacman -U /path/to/your/intel/driver/package
  
  # adjust xorg.conf symlink
  ln -sf /etc/X11/xorg.conf-intel /etc/X11/xorg.conf
fi

This assumes that  you need a different xorg.conf depending on the driver in use, so you'd use a symlink at /etc/X11/xorg.conf that points to the correct file (for example /etc/X11/xorg.conf-intel or /etc/X11/xorg.conf-nvidia). If your x is running fine for both drivers without using an xorg.conf you can of course skip this step.

This is probably the simplest approach. Another way would be to modify the nvidia and libgl package to install the the libGL.so* files in a way that they don't conflict with each other, and using symlinks to point to the actual files that are required, switching them around as necessary. This would involve a lot of fiddling, and may not be worth the hassle of maintaining your own custom packages.

The above example reinstalls the driver on every boot. It should be simple to do this only if required. Some error checking might be a good idea, too ;)

Offline

#4 2009-08-22 11:21:35

lisa860
Member
Registered: 2009-08-22
Posts: 2

Re: How to switch between Video drivers?

Thanks a lot for your effort hbekel smile

Offline

#5 2009-08-22 11:55:05

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: How to switch between Video drivers?

Depending on your needs the xf86-video-nv module might work for you. If it does all you have to do is switch the driver line in xorg.conf


Website - Blog - arch-home
Arch User since March 2005

Offline

Board footer

Powered by FluxBB