Wayland Hardware, Drivers, and Troubleshooting

There is a bug in the wayland demo compositor causing corrupted graphical output when a background is not used (2011-02-27).

In --with-egl-platforms=wayland,drm wayland must be first, or the environment variable EGL_PLATFORM=wayland must be set.

http://lists.freedesktop.org/archives/wayland-devel/2010-November/000292.html

AMD/ATI vs. Intel vs. nVidia

AMD/ATI and Intel provide good open-source drivers. nVidia has never provided so much as documentation to assist development of open-source drivers. For these reasons, I don't plan to ever buy another nVidia video card.

Wayland under X with Ubuntu

You may need to grant yourself permission to use DRI:

 sudo usermod -a -G video username
Where "username" is your username.

nVidia DRI on Ubuntu

If you have an nVidia video card, to switch to nouveau with DRI:

  sudo apt-get install libgl1-mesa-dri-experimental xserver-xorg-video-nouveau
Then disable the proprietary driver via System / Administration / Additional Drivers, and reboot.
Note: That "experimental" package (needed only for nVidia DRI) is so experimental that upstream is not even accepting bug reports yet. Also, it's in the Universe repository. Ubuntu is considering enabling it in Natty by default anyway.

Build Problems

If the build complains about missing packages, it's probably talking about pkg-config type packages, not your distribution packages. If it complains about missing package "example", you can find the necessary Debian based packages by:

   sudo apt-get install apt-file && sudo apt-file update && apt-file search /example.pc

"libEGL warning: DRI2: failed to authenticate" probably means either that you're using an old version of mesa (wrong library path?) or don't have DRI2 support in your X server. Both the nVidia and AMD/ATI proprietary drivers apparently lie about having DRI2 support.

"DRI2: failed to get driver name" probably means you're trying to use egl_dri2 instead of gallium, and the PCI ID of your video card is not listed in mesa's dri2_driver_map in src/egl/drivers/dri2/egl_dri2.c (list of supported video cards). This should not be a problem as of 2011-02-13.

"DRI2: failed to connect, DRI2 version: 0.0" probably means you don't have DRI2 support. This also happens when you try to run the compositor under X with the ATI/AMD proprietary FGLRX graphics driver (disable it and switch to the open source driver).

"DRI2: failed to connect, DRI2 version: 1.1" - this is what I get when I try to run the compositor with the proprietary nVidia driver (disable it and switch to nouveau).

"Failed to compile keymap" probably means you did not build libxkbcommon with something like "--with-xkb-config-root=/usr/share/X11/xkb", so it's looking in the wrong place for your xkb datafiles.

"no drm device found" can result if you have an Nvidia card newer than is supported by Nouveau, an NVC0 / Fermi family card. With this problem, dmesg output includes a line like:
[ 9.010119] [drm] nouveau 0000:02:00.0: Unsupported chipset 0x0c0000a3
And /var/log/Xorg.*.log will include something like:
[ 11.463] (EE) [drm] failed to open device
The solution requires loading external firmware.

"libEGL warning: DRI2: failed to open nouveau (search paths /home/darxus/install/lib/dri)" means you're missing the Gallium3D driver for nouveau, /home/darxus/install/lib/dri/nouveau_dri.so which should have been built by mesa.

<scientes> $ bin/weston
<scientes> EGL_KHR_surfaceless_gles2 not available
<scientes> failed to create compositor
<soreau> scientes: You need to install libxcb-dri2-0-dev then rebuild mesa

File libwayland-egl.so is built by building mesa with --with-egl-platforms=x11,wayland,drm .

With any other build problems, run the script one line at a time to figure out where the problem is.

Once everything has built without error, if the compositor won't work, you may be able to find the problem using strace.

Nouveau Kernel

Commits required for Wayland demo DRM output: NV0x-NV4x, NV50, NVC0, Page flip fix.

There is a bug open against nouveau related to corrupted graphical output via DRM.

Mesa

Mesa commit sets required by Wayland demos:

BGRA8888

mesa: allow internalFormat=GL_BGRA_EXT in TexImage2D
mesa/es: require internalFormat==format in TexImage2D
st/mesa: support internalFormat=GL_BGRA in TexImage2D
st/mesa: Enable EXT_texture_format_BGRA8888 for gles1/2

wayland-egl

Add dri2::{Allocate,Release}Buffer extension
st/dri: Implement dri2::{Allocate,Release}Buffer
intel: Implement dri2::{Allocate,Release}Buffer
egl: Add wayland platform
egl: Implement libwayland-egl
st/egl: native_helper: Add resource_surface_import_resource
st/egl: drm_image: Check for MESA_drm_image
st/egl: Add wayland platform
egl_dri2: Enable pixmap bind_to_texture according to the extension
egl_dri2: Export dri2_get_driver_for_fd
egl_dri2: Add wayland platform
wayland-egl: Force roundtrips to get device name and authenticate correctly

Mesa commit required to use Nouveau with egl_dri2 (means nothing requires egl_gallium):
egl_dri2: add nouveau support.

NVC0

This latest family of Nvidia cards requires loading external firmware.

Building a Nouveau kernel


Building and installing a nouveau kernel from the nouveau git repo is surprisingly easy:

$ git clone --depth 1 git://anongit.freedesktop.org/nouveau/linux-2.6
$ cd linux-2.6
$ cp /boot/config-`uname -r` .config # use .config of currently running kernel
$ yes "" | make oldconfig # use defaults for new options
$ make clean && make && make modules && sudo make modules_install && sudo make install

Ubuntu Maverick's /sbin/installkernel is broken, requring these additional commands:

$ mkinitramfs -o initrd.img `make kernelversion`+
$ sudo mv initrd.img /boot/initrd.img-`make kernelversion`+
$ sudo update-grub

To uninstall a kernel installed this way:

$ sudo rm /boot/initrd.img-`make kernelversion`+ /lib/modules/`make kernelversion`+
$ sudo update-grub
Wayland index
Sat Mar 24 12:29:15 EDT 2012