• Home
Name Date Size #Lines LOC

..--

mesa-driver-builder/03-May-2024-10273

README.mdD03-May-20242.8 KiB7247

VERSIOND03-May-20241

common.pyD03-May-2024589 2711

create.pyD03-May-2024888 4123

create_and_upload.pyD03-May-2024951 4325

download.pyD03-May-2024278 174

upload.pyD03-May-2024268 174

README.md

1Creating the Mesa Intel Linux driver asset (which supports Vulkan)
2============================================================
3
4Using the automated asset python scripts requires that Docker be installed.
5
6    mesa_intel_driver_linux$ python create_and_upload.py
7
8See below for steps on just building the driver.
9
10Using Docker
11------------
12It is easiest to just use the pre-built docker image.
13
14    docker run -v /tmp/out:/OUT -e MESA_VERSION=18.1.7 gcr.io/skia-public/mesa-driver-builder:latest /opt/build_mesa.sh
15
16You may change `/tmp/out` to be the desired output directory and `18.1.7` to be the desired
17version of the mesa driver.
18
19Finally, use `/tmp/out` as the input directory to the upload script.
20
21Building it manually
22--------------------
23If Docker is not installed, these steps may be used to build the driver.
24This is known to work on Ubuntu 18.04, but is stale since we use the Docker container
25for day-to-day builds.
26
27Install all deps
28
29    sudo apt-get install autoconf libtool scons flex bison llvm-dev libpthread-stubs0-dev x11proto-gl-dev libdrm-dev libdrm2 x11proto-dri2-dev x11proto-dri3-dev x11proto-present-dev libxcb1-dev libxcb-dri3-dev libxcb-present-dev libxshmfence-dev xserver-xorg-core xserver-xorg-dev x11proto-xext-dev libxext-dev libxdamage-dev libx11-xcb-dev libxcb-glx0-dev libxcb-dri2-0-dev libva-dev libomxil-bellagio-dev
30
31    sudo pip install mako
32
33The following steps are also represented in `mesa-driver-builder/build_mesa.sh`
34
35Get the source from ftp.freedesktop.org/pub/mesa/
36
37    MESA_VERSION=18.1.7
38    wget ftp://ftp.freedesktop.org/pub/mesa/mesa-$MESA_VERSION.tar.gz
39    gunzip mesa-$MESA_VERSION.tar.gz
40    tar --extract -f mesa-$MESA_VERSION.tar
41    mv mesa-$MESA_VERSION/ mesa
42    cd mesa
43
44
45Build the driver
46
47    # For the debug resource, use --enable-debug
48    mesa$ ./autogen.sh --disable-radeon --with-gallium-drivers=i915 --with-vulkan-drivers=intel
49    mesa$ make -j 50
50
51
52Tweak icd.json file and output dir (mesa/lib)
53
54    mesa$ cp src/intel/vulkan/intel_icd.x86_64.json lib/
55    # modify the pathname in the intel_icd.x86_64.json file to be ./libvulkan_intel.so
56    mesa$ rm -rf lib/gallium  # We don't need this
57    mesa$ rm lib/nouveau_vieux_dri.so lib/r200_dri.so lib/radeon_dri.so # We don't need these
58
59Finally, use mesa/lib as the input directory to the upload script.
60
61
62Docker Image Maintanence
63------------------------
64The docker image `mesa-driver-builder` is an Ubuntu container with many build
65tools installed (including Clang 6). It is designed specifically to build the mesa driver.
66
67The image only needs to be re-built when the dependencies change or the build_mesa.sh is updated.
68
69    docker build -t mesa-driver-builder ./mesa-driver-builder/
70    # use v1, v2, v3, etc to handle changes/updates to the image.
71    docker tag mesa-driver-builder gcr.io/skia-public/mesa-driver-builder:v1
72    docker push gcr.io/skia-public/mesa-driver-builder:v1