Introduction

By default Ubuntu will use the open source video driver Nouveau for your NVIDIA graphics card. This driver lacks support for 3D acceleration and may not work with the very latest video cards or technologies from NVIDIA.

An alternative to Nouveau are the closed source NVIDIA drivers, which are developed by NVIDIA. This driver provides excellent 3D acceleration and video card support.

NVIDIA drivers provided by the Ubuntu repositories

What package one would use depends on the version of Ubuntu one is using, and what graphics card one has installed.

Installation

Usually you will see a notification and/or an icon in the top panel, reminding you that restricted drivers are available.

restricted_drivers.jpg

By clicking the icon you will be taken to a dialog where you can choose which version you want to install, choose the recommended driver.

drivers_dialog.png

If you are using an older version of Ubuntu, or if you aren't notified about additional drivers, you can launch the installation yourself.

Removing Nouveau (advanced/expert users)

Nouveau is installed by default. It's possible to remove it completely, but it is not necessary and therefore not recommended.

If you still desire to remove it, you can do so by entering the following command in a terminal:

sudo apt-get --purge remove xserver-xorg-video-nouveau

Installation without X / from the console

The jockey-text command was removed with the release of Ubuntu 14.04. You can now use ubuntu-drivers to get the list of packages for each driver, and then install the packages using apt-get. For example:

sudo ubuntu-drivers devices

== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==

vendor   : NVIDIA Corporation
modalias : pci:v000010DEd00000DDAsv000017AAsd000021D1bc03sc00i00
model    : GF106GLM [Quadro 2000M]
driver   : xserver-xorg-video-nouveau - distro free builtin
driver   : nvidia-304-updates - distro non-free
driver   : nvidia-304 - distro non-free
driver   : nvidia-331 - distro non-free recommended
driver   : nvidia-331-updates - distro non-free

sudo apt-get install nvidia-331

Troubleshooting

Installation Fails

Driver Not Active

Boot Splash Screen Issues

Can't Save Settings

nvidia-settings can't write to xorg.conf if it hasn't been started with administration privileges. Make sure you start nvidia-settings with the following command:

gksudo nvidia-settings

Some text (for example in menu) is rendered incorrect

With a Ge Force 7600, after installation of the nvidia driver in Ubuntu 14.04 some text and icons are rendered incorrectly, sometimes content is displayed distorted in a triangle instead of a rectanglar window, and X resets intermittently.

Using nouveau the XGA resolution 1024x768 is configured and works. However, manually changing to a different resolution with xrandr, etc. fails.

In order to address these issues, install nvidia-304-updates driver, and change the resolution from auto to something different in nvidia X server settings.

Suspend/Hibernation

If you use an old NVIDIA driver, hibernation and/or suspend may not work. Here is a potential work around:

Onboard Graphics Chipset

Low/Missing Screen Resolutions

Often screen resolutions on offer are far lower than those offered with the open source driver. The NVIDIA binary driver seems to be very weak at reliably probing this information from the monitor and relies on additional information in xorg.conf.

To fix this you can add more resolutions by entering the following in a terminal:

xrandr --addmode S-video ...

Replace the dots with the desired resolution. For further details and potential workarounds see X config resolutions.

Low Resolution Icons and OS Features

If you have problems with low resolution icons, shortcuts and menus placed strangely, and especially desktop size not matching your monitor, this may be due to a bug with multiple monitor setup. If you've previously setup a second monitor and have it plugged in but not turned on, Ubuntu/Xubuntu may be counfounded by this. The simplest method to resolve this is to remove the redundant cable from your machine and reboot. Additionally, install arandr (GUI for xrandr editing) and setup two profiles, one with the secondary monitor and one without. Removal of redundant cable when not in use is nonetheless still recommended. This problem was experienced in Ubuntu and Xubuntu.

Screen Blanks/Monitor Turns Off

Using a laptop with a GeForce Go card, or connecting the sole display via DVI on a dual-head system sometimes results in the screen not receiving a picture. This is caused by the driver outputting video to the VGA port on the graphics card, instead of DVI.

The usual hint that you have this problem is when you hear the startup sound but nothing appears on the screen. If you do not hear any sound, you are more than likely experiencing unrelated problems.

This is a bug about displays on digital outputs being blank when using NVIDIA driver, and can be resolved by editing your /etc/X11/xorg.conf file:

Problems with Video Playback

If you have problems with video playback in e.g. mplayer, gxine, or mythtv frontend with a legacy card, it may be due to too high a color depth (e.g. using NT6 Vanta/Vanta LT "nvidia" driver, I experienced flickering vertical bars & blue screen flashing). To fix this, manually edit /etc/X11/xorg.conf and change DefaultDepth to 16.

Creating Application Profiles

nVidia X Server Settings has an application profiles editor much like the Windows counterpart (nVidia Control Pannel) that allows you to set special parameters per-application. For manual text file editing read the Application Profiles ReadMe included in the nVidia for Linux Driver ReadMe. It is quite detailed on where the file locations are, how to enable or disable application profiles completely and what arguments you can use.

For using the nVidia X Server Settings? Follow this basic guide (I'll use Quake 4 as an example)

We've now created an application profile. One of these days I will list the different process names for ID Tech 4 engine-based games for Linux and their procname's so anyone could easily create working SLI Profiles for these games. I've attempted to use GLDoom3 on other game engines such as the Spark Engine used by Natural Selection 2... sadly it only made the game run at the speed of one GPU, still not enabling the second one to work in SLI outside the ID Tech 4 Engine...

NOTE: The OpenGL Environment Variables are not all listed in the ReadMe. GLDoom3 for example is only discussed in the SLI portion of the driver's ReadMe.

NVIDIA Optimus

Nvidia Optimus is a computer GPU switching technology created by Nvidia which, depending on the resource load generated by client software applications, will seamlessly switch between two graphics adapters within a computer system in order to provide either maximum performance or minimum power draw from the system's graphics rendering hardware.

A typical platform includes both a lower-performance integrated graphics processor by Intel and a high-performance one by Nvidia. Optimus saves battery life by automatically switching the power of the discrete graphics processing unit (GPU) off when it is not needed and switching it on when needed again. Unfortunately, automatic switching between integrated GPU and discrete GPU is not fully supported in Linux.

There are several options available in Ubuntu:

Using prime-select method

You can use either integrated Intel GPU or discrete NVIDIA GPU with this method. After installing proprietary NVIDIA Driver, to switch integrated Intel GPU, simply run this command:

sudo prime-select intel

To switch NVIDIA GPU, run this command:

sudo prime-select nvidia

NOTE: After running the commands above you have to reset your computer or logout then login to your session.

To determine which GPU is being used, run this command:

sudo prime-select query

If you don't prefer using terminal, you can switch between cards with NVIDIA X Server Settings:

nvidia-x-server-prime-select.jpg

Using NVIDIA PRIME render offload method

This method is available since NVIDIA Driver 435.17. After installing proprietary NVIDIA Driver, X Server should automatically configure NVIDIA PRIME render offload, but for some reason if you need to configure this explicitly, for example if you have a dual screen setup, create a new configuration:

/usr/share/X11/xorg.conf.d/20-intel.conf

Fill the configuration with the following content:

Section "Module"
    Load "dri3"
EndSection

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "intel"
    Screen 1 "nvidia"
EndSection

Section "Device"
    Identifier "intel"
    Driver "intel"
    Option  "DRI" "3"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    Option "ConstrainCursor" "off"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration" "on"
    Option "IgnoreDisplayDevices" "CRT"
EndSection

After rebooting your system PRIME render offload should be available for your system. Make sure that you've selected this option in NVIDIA X Server Settings:

nvidia-x-server-prime-offloading.jpg

To run the graphical application with discrete GPU, use this command:

__NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia "$@" <application name>

Or you can install prime-run package from Launchpad PPA, which is a packaged version of the command above.

Alternatively, if you are using GNOME Desktop Environment 3.36 and newer, you can right click to applications in application dock and select Launch using Dedicated Graphics Card option.

NOTE: NVIDIA Pascal and lower architecture graphics cards does not fully power off with this method for the time being.

SLI / Multi-GPU

NOTE: This was last tested with nVidia 343.13 drivers. Despite these drivers adding support for the GTX Titan Z, a Multi-GPU videocard it still does not support SLI. So, the GTX Titan Z is reduced to a single GTX Titan in Linux. The same goes for other nVidia Multi-GPU cards such as the GTX 690. sad

For more information, please read SLI & Multi-GPU section of the ReadMe included with nVidia's drivers for Linux.

Current limitations (last tested on 343.22) on nVidia's drivers are as follows:

Alternate Frame Rendering (AFR) is supported. This SLI mode uses each card to render one frame then the next card renders the following. For example, in two-way AFR, GPU1 renders frames 1, 3, 5, etc. and GPU2 renders 2, 4, 6, etc. Outside of the ID Tech 4 engine Alternate Frame Rendering does not work on any card other than the first which causes framerates to drop by 50%. This is a known bug and nVidia are currently working on this issue.

SLI Profiles are NOT included with the drivers unlike the Windows version of the nVidia drivers. They must be manually created for ID Tech 4 Engine-based games. To learn how to make them yourself, please read the Creating Application Profiles section of this wiki page.

Split Frame Rendering (SFR) is also supported. This mode uses the first GPU to render the top half of the screen, and the second GPU to render the bottom half. This mode also does not function correctly outside of ID Tech 4. It will still render the full screen, but only at the speed of a single GPU.

Alternate Frame Rendering mode 2 (AFR2) is NOT supported in Linux. This mode is opposite of Alternate Frame rendering by instead using the last GPU as the primary, and every GPU above it as the next in line. For example, in three-way AFR2? GPU3 renders frames 1, 4, 7, etc. GPU2 renders frames 2, 5, 8, etc. and GPU1 renders frames 3, 6, 9, etc. In Windows, AFR2 is the preferred SLI mode as it tends to yeild higher performance over AFR. My theory is because GPU1 is the primary card for video out, it uses a different GPU for the primary calculations it better balances the work load. I have not seen any documentation as to the specific reason AFR2 performs better.

Despite what was mentioned above, if you wish to try SLI here's how to enable it via the terminal:

Terminal commands:

sudo nvidia-xconfig -sli=on
sudo nvidia-xconfig -sli=auto
sudo nvidia-xconfig -sli=afr
sudo nvidia-xconfig -sli=sfr
sudo nvidia-xconfig -sli=off

The Only difference is if you have a Multi-GPU (such as the GTX 690) you change the argument of sli to multigpu. Terminal commands:

sudo nvidia-xconfig -multigpu=on
sudo nvidia-xconfig -multigpu=auto
sudo nvidia-xconfig -multigpu=afr
sudo nvidia-xconfig -multigpu=sfr
sudo nvidia-xconfig -multigpu=off

If you have Multi-GPU cards in your system in SLI (such as two GTX 690's with the appropriate SLI bridge) you just have to mix the commands together.Terminal commands:

sudo nvidia-xconfig -sli=on -multigpu=on
sudo nvidia-xconfig -sli=auto -multigpu=auto
sudo nvidia-xconfig -sli=afr -multigpu=afr
sudo nvidia-xconfig -sli=sfr -multigpu=sfr
sudo nvidia-xconfig -sli=off -multigpu=off

SLI Application Profiles for ID Tech 4 Engine Games

The Application profile examples I have below are for:

NOTE: This list was compiled with NVIDIA 343 drivers.

Essentially, just enable "GLDoom3" and also "GLThreadedOptimizations". One may also setup an "AlwaysOn" profile setting for "GLThreadedOptimizations" as an example of settings you can always have activated. It's up to you to leave it on or disable it since there's the chance it can affect your OpenGL performance negatively.

To use these application profiles, one way is via the file manager.

Filing bug reports

NVIDIA driver from the Ubuntu repositories

If one is using a NVIDIA driver package from a supported Ubuntu repository (not downloaded from NVIDIA's website directly), then one is welcome to file a new report via a terminal:

ubuntu-bug xorg

Please ensure you have xdiagnose installed, and that you click the Yes button for attaching additional debugging information.

As well, please ensure all of the below are tested and provided:

If the issue is not reproducible in the version from NVIDIA's website, then the issue would be a downstream (Ubuntu) issue.

If the issue is reproducible in the version from NVIDIA's website, the next step is to report a bug upstream as per below.

Reporting an upstream bug

If either your downstream bug report is marked Triaged, or you are using the drivers from NVIDIA's website directly, one will want to file a bug report via the NVIDIA Bug Submissions website.

Next, one would want to contact NVIDIA customer care via Live Chat in order to identify a WORKAROUND, and generate a trackable case number regarding your problem.

See Also


CategoryHardware CategoryX CategoryXwindowSystem CategoryVideo

BinaryDriverHowto/Nvidia (last edited 2021-08-06 11:33:13 by bw3u)