Xorg - proprietary video driver support improvements

Registered by Bryce Harrington

Evaluate some packaging improvements to make use of the proprietary video drivers (fglrx and nvidia) more seamless for users.

 * Fix DKMS to ensure kernel modules always build for all installed kernels before gdm starts. (LP: #474917, #438398)
 * Improve apport scripts for reporting bugs against each driver. Derive driver-specific scripts from 'xorg/debian/apport/source_xorg.py' that include make.log, etc.
 * Improve packaging documentation for nvidia (see fglrx debian/README as example of what is needed)
 * Make fglrx and nvidia load by default if installed. See patches 104 and 105 in xorg-server, and Nov 2009 thread on ubuntu-x@. Needs tested with or without xorg.conf present on system.
 * Document a standardized testing procedure for each driver - https://wiki.ubuntu.com/X/Testing/ProprietaryDrivers
 * Look into feasibility of using an alternatives system rather than diversions to avoid breaking OpenGL libraries when installing proprietary drivers (LP: #258038). See https://wiki.ubuntu.com/X/ProprietaryDrivers/IntegrationImprovements
 * Further ideas to improve user experience with installing proprietary drivers


See also:

Work items:
[bryceharrington] Include make.log file(s) to apport hook: DONE
[bryceharrington] Include dkms status to apport hook: DONE
[bryceharrington] Verify make.log and dkms status are being collected: DONE
[albertomilone] Write packaging documentation for the -nvidia package: DONE
[sarvatt] Fix logic in patches 104 and 105 to correctly select -nvidia when appropriate: DONE
[sarvatt] Ensure fallbacks work if nvidia/fglrx is failing to load: DONE
[bryceharrington] update -nouveau package description to be less scary: DONE
Auto-config nvidia: Identify logic in jockey which inserts configuration into xorg.conf and create analogous logic in xserver: DROPPED
[bryceharrington] Write https://wiki.ubuntu.com/X/Testing/ProprietaryDrivers: DONE
[bryceharrington] Get a couple people to review test plan and give improvement suggestions: DONE
[albertomilone] Store libraries, modules, extensions in /usr/lib/<driver>/: DONE
[albertomilone] Call ldconfig after updating alternatives.: DONE
[albertomilone] Rename kernel modules in dkms.conf: DONE
[albertomilone] Store additional binaries in /usr/lib/<driver>/bin: DONE
Detect gfx hardware changes (maybe by checking the modaliases?) and inform users about the change.: POSTPONED
Implement dialog that pops up in Failsafe-X to suggest enabling driver for new hardware: POSTPONED
[albertomilone] Make sure that diversions from previous installations do not cause problems with updates: DONE
[albertomilone] Install /usr/lib/nvidia/pre-install and /usr/lib/nvidia/failed-install: DONE
[albertomilone] Change the names of the current Nvidia drivers to nvidia-current: DONE
[albertomilone] Update nvidia-common so that it can deal with the new names of the Nvidia drivers: DONE
[albertomilone] Add a check (in nvidia-common) to require uninstalling Nvidia's driver when installing Ubuntu packages: POSTPONED
[albertomilone] Update nvidia-settings so that it matches the version of nvidia-current: DONE


pitti, 2009-11-25:
 - http://launchpadlibrarian.net/35289345/dkms_upstart.debdiff will break dkms on servers, since none of the startup conditions will ever get satisfied any more; I think the only ways to ensure this with current upstart is to (1) call the dkms autoinstaller in gdm/kdm's upstart jobs directly, or (2) make gdm/kdm depend on dkms and introduce an upstart dependeny of the *dm jobs to dkms_autoinstaller.
 - "Modules and extensions (e.g. libglx.so, nvidia_drv.so, libdri.so, etc.) are stored in /etc/$PROPRIETARY_DRIVER_NAME/xorg/ " -> this should not be /etc/ for sure?
  + [tseliot] This was a typo. All libraries will live in /usr/lib/. I've corrected the wiki page.
 - I suppose it is not actually feasible to have multiple nvidia-$version kmods loaded by default; do the modprobe.d scripts ensure that the other version is unloaded first? that won't work if X is still running. The use case talks about "switch between video cards as she desires", but the spec does not explain how this works. Or does that rely on a reboot, and drivers are never modprobed automatically after boot? (Probably the safer approach).
  + [tseliot] That will require a reboot. Even if we managed to unload the current kernel module when X is running (which is not the case) we couldn't reload GL libraries, etc.
 - no /etc/X11/Xsession.d/ script please, if possible, as they block the entire desktop loading; can these become an autostart desktop file instead? or do these need to run before any session bit starts to run?
  + [tseliot] A desktop file will be fine.
  - I have some doubts about naming a package "nvidia-current"; how would that avoid breaking an user's installation on a dist-upgrade when the new "current" version does not support the graphics card any more? Wouldn't it be more robust to only use major version numbers and deprecate the old versions by the usual transitional packages/replaces/conflicts:?
  + [tseliot] Good point.
superm1, 11-30:
 - Regarding the lack of server support by moving to upstart. I saw a neat little trick that colin added to the oem config upstart script. I think this would solve it:

start on (starting gdm
          or starting kdm
          or starting xdm
          or stopping rc RUNLEVEL=[2345])

 - nvidia-current: I'm still in favor of a single "main" current package without the version number in it. Here's how I think a transition can play out if someone's card stops being supported:
 * A user has an NVIDIA 8600 that is fully supported by the NVIDIA 190 series drivers that are going into Lucid. They would install "nvidia-current" and have full support.
 * For Lucid+1, NVIDIA introduces an NVIDIA 195 series driver that drops support for the 8600 and less series cards. Because of this, a new source package has to be created, and it will generate an nvidia-190 binary package.
 * Update manager needs to be notified of this transition, and EVERYONE on the nvidia-current from Lucid would then be transitioned onto the "nvidia-190" for Lucid+1. There will still be people who "can" use nvidia-current on Lucid+1, but then that's up to them to go and try on their own.


albertomilone, 2010-01-01:
* All the required bits to get the alternatives system (i.e. drivers, nvidia-common, nvidia-settings, xserver) are ready for testing in my PPA: https://edge.launchpad.net/~albertomilone/+archive/proprietary-video-improvements

pitti, 2010-01-05: Removed whiteboard work items which are also covered by linked bugs

bryce, 2010-02-12: Mario reports that dkms now has apport support added to it.

bryce, 2011-11-15: Remaining postponed work items moved to desktop-p-xorg


Work Items