I've been pulling my hair out over this one for a couple of days now, google is no help.

I've created a wonderful (until this issue) portable copy of Ubuntu linux that will boot on mostly anything by using a USB enclosure for my laptop's 80GB SATA drive. So far so good, it boots and runs on everything, and on non-nVidia card setups was even detecting the drivers, or letting me install the required drivers for hardware acceleration and compiz. Because you know, the wobble windows are the most awesome thing ever.

Anyway, my desktop machine had an nVidia card, so I'm thinking, sure, I'll just install the nVidia drivers like before and everything will work happily. Not so-- now the desktop and any other nVidia cards work great, but it seems to have completely disabled any other graphics cards. When the kernel module detects that an nVidia card isn't present, it shoots up this nasty little dialog box giving me the option to boot into "low graphics" mode, which doesn't even allow me to use the correct screen resolution, much less see the installed graphics card and try to configure a driver for it.

Is there any way to configure Ubuntu (with the dreaded nVidia kernel module) so that it can use nVidia's drivers when an nVidia card is present, and default to the normal (not low-graphics) setup in other cases, so that it has a fair chance of using what's actually present? I'm not afraid to much with config files, I just don't know the underlying system well enough to feel comfortable diving in without a push in the right direction.

Thanks guys!

  • Oh: I should mention, I'm using Gnome and a fairly Vanilla Ubuntu setup here. The only exception is the installation of the compiz settings manager, but I don't think that changes anything other than letting me tweak compiz itself. – Nicholas Flynt Feb 27 '10 at 0:30
  • removed the portable-ubuntu tag because that's used for the Portable Ubuntu Remix project. if that's what you are using, feel free to add it back; if you're just using standard Ubuntu on an external drive, ubuntu is the more approprite tag. – quack quixote Apr 9 '10 at 21:00

Here's an init script that will detect if an Nvidia graphics device is present. If there is an NVidia device at boot up it will use an appropriate xorg.conf. If there is not an NVidia device it will use no xorg.conf and let Xorg do its auto-configure thing. Save the following to /etc/init.d/nvidia-check

# Provides:       nvidia-check
# Required-Start: $local_fs
# Required-Stop:  $local_fs
# Default-Start:  5
# Default-Stop:   0 1 6
# Description:    Check for an nVidia graphics device and setup xorg.conf appropriately

# TODO: nvidiadetector.py from Ubuntu package nvidia-common would probably be more robust here
  lspci | grep VGA | grep -q nVidia

  if have_nvidia_vga_device ; then
    echo "nVidia device detected."
    if [ -f /etc/X11/xorg.conf.nvidia ]; then
    cp /etc/X11/xorg.conf{.nvidia,}
    echo "ERROR: No nVidia xorg config file missing: /etc/X11/xorg.conf.nvidia"
    return 1
    echo "No nVidia device detected."
    rm -f /etc/X11/xorg.conf

  if have_nvidia_vga_device && [ -f /etc/X11/xorg.conf ]; then
    echo "Saving nVidia xorg.conf configuration to: /etc/X11/xorg.conf.nvidia"
    # *Move* the xorg.conf file to be "fail safe" at next boot
    mv /etc/X11/xorg.conf{,.nvidia}

case "$1" in
  start || exit 1

  stop || exit 1

  stop || exit 1
  start || exit 1
  echo "Usage: $0 {start|stop|restart}"
  exit 1

Install with:

sudo chmod +x /etc/init.d/nvidia-check
sudo chkconfig --add nvidia-check

This posting on How to install Nvidia/ATI graphic cards drivers in Ubuntu 9.04 may be useful in identifying what is missing on your system.

I use a similar flash drive installation across two different nVidia systems and a host of other machines. I have also noticed inability to handle graphics on some of the platforms -- this was specifically when on-board Intel graphics based platforms. On several occasions I have tried to bump-up the graphics after booting on the new platform and successfully managed to get drivers to do so.

  • I basically followed those steps, I got my nVidia driver through the Hardware manager. That's the trouble-- now I can't make it go away cleanly. – Nicholas Flynt Feb 27 '10 at 1:30

AFAIK, when you install the Nvidia drivers, they overwrite your /etc/X11/xorg.conf file to allow (force) you to use the Nvidia driver on subsequent boots. If you revert your xorg.conf file to the previous version (it should have saved a backup in the same directory) you should be able to restore the old behavior. (If you don't have your old xorg.conf file, you can probably get away with removing the one that's there and letting your system auto-detect what driver it needs.)

Unfortunately, I don't think Nvidia's driver will work without specifying that driver in Xorg's configuration. So in order to achieve what you want, you'd probably have to jury rig something that would detect if the system had an Nvidia card before Xorg starts, and then automatically set up the correct Xorg configuration so that Xorg loads the Nvidia driver when it's supposed to.

I'm a bit of a newbie and there might be a better solution that I'm unaware of, but that's my two cents.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.