Commit 400d4d2b authored by Tomeu Vizoso's avatar Tomeu Vizoso
Browse files

RFC: Add instructions for using a docker image.

parent 6c12e571
# How to setup a working environment for virglrenderer.
`export ALT_LOCAL=/opt/local/virgl`
`export PKG_CONFIG_PATH=$ALT_LOCAL/lib/pkgconfig`
$ sudo apt-get install docker
$ docker login registry.freedesktop.org # You will need a token for accessing the registry in fdo
$ docker pull registry.freedesktop.org/tomeu/virglrenderer
## LIBEPOXY
You need a version of libepoxy that contain `7c4817f`
(See https://github.com/anholt/libepoxy/issues/147 for more details).
You can build it from source or get the binary from your system (>= v1.5.1).
$ git clone https://gitlab.freedesktop.org/tomeu/virglrenderer.git
$ cd virglrenderer
$ docker run --device=/dev/dri/renderD128 \
--device=/dev/kvm \
-v $PWD:/virglrenderer \
-v /local/path/to/qemu/sources:/qemu \
registry.freedesktop.org/tomeu/virglrenderer:latest \
/virglrenderer/ci/run-tests.sh
## VIRGLRENDERER
Building virglrenderer.
Clone the development repo:
`git clone https://gitlab.collabora.com/virgl-es/virglrenderer.git`
Checkout the hacks branch:
`git checkout hacks`
Configure the build:
`./autogen.sh --prefix=$ALT_LOCAL`
Build:
`make`
Install:
`make install`
And you can start hacking on virglrenderer and qemu and the changes will be picked up in subsequent runs.
## QEMU
Building qemu.
Clone the development repo:
`git clone git://git.qemu.org/qemu.git`
Configure the build:
`./configure \
--prefix=$ALT_LOCAL \
--target-list=x86_64-softmmu \
--enable-kvm \
--disable-werror \
--enable-virglrenderer`
Build:
`make -j`
Install:
`make install`
If you also want to hack on Mesa, mount the local src dir as a volume in /mesa and copy the build recipe from the Dockerfile.
## LIBPCIACCESS
Clone the repo:
`git clone git://anongit.freedesktop.org/xorg/lib/libpciaccess`
Configure the build:
`cd libpciaccess`
`./autogen.sh --prefix=$ALT_LOCAL`
Build:
`make -j`
Install:
`make install`
## MESA
Clone the repo:
`git clone git://anongit.freedesktop.org/mesa/mesa`
Configure the build:
`./configure --prefix=$ALT_LOCAL \
--enable-driglx-direct \
--enable-gles1 \
--enable-gles2 \
--enable-glx-tls \
--with-egl-platforms='drm x11 wayland' \
--with-dri-drivers="i915 i965" \
--with-gallium-drivers="nouveau swrast virgl" \
--enable-texture-float`
Build:
`make -j$(nproc --ignore=1)`
Install:
`make install`
## UBUNTU
Build an image with debootstrap as per the instructions in the link below:
http://www.olafdietsche.de/2016/03/24/debootstrap-bootable-image
But with the actual execution of debootstrap as follows:
# debootstrap bionic bionic-chroot
On first boot:
apt-get install ubuntu-desktop ubuntu-standard
Running qemu using the freshly compiled mesa libraries and drivers:
export LD_LIBRARY_PATH=$ALT_LOCAL/lib
export LIBGL_DRIVERS_PATH=$ALT_LOCAL/lib/dri
x86_64-softmmu/qemu-system-x86_64 \
-enable-kvm -M q35 -smp 2 -m 4G \
-hda ubuntu.qcow2 \
-net nic,model=virtio \
-net user,hostfwd=tcp::2222-:22 \
-vga virtio \
-display sdl,gl=es
## GUEST
Install latest mesa (see above), change the gallium drivers to
`--with-gallium-drivers="virgl"`
Set up LD_LIBRARY_PATH and LIBGL_DRIVERS_PATH like above.
Clone VK-GL-CTS:
`git clone https://github.com/KhronosGroup/VK-GL-CTS.git`
Build it as describe in the following doc:
`https://github.com/KhronosGroup/VK-GL-CTS/blob/master/external/openglcts/README.md`
cd VK-GL-CTS
mkdir build
cd build
cmake .. -DDEQP_TARGET=x11_egl -DGLCTS_GTF_TARGET=gles2
cmake --build .
Clone deqp_runner:
`git clone https://gitlab.collabora.com/virgl-es/deqp_runner.git`
To run all the Android GLES2 conformance tests in hasty (fast) mode:
`python3 deqp_runner/deqp_runner.py --cts-build-dir VK-GL-CTS/build/ --hasty --hasty-batch-size 1000 --test-names-file VK-GL-CTS/android/cts/master/gles2-master.txt`
To run one test:
`python3 deqp_runner/deqp_runner.py --cts-build-dir VK-GL-CTS/build dEQP-GLES2.functional.texture.mipmap.2d.generate.la88_fastest`
Alternative ways to run tests:
To run all the tests
`./cts-runner --type=es2 --verbose > file.txt`
To run one test
`./glcts --deqp-case=dEQP-GLES2.functional.texture.mipmap.2d.generate.la88_fastest`
## Visualation of results
When running a tool like `deqp-gles3` directly a results file (default: TestResults.qpa) is created.
In order to visulaize these results one can do:
python2 VK-GL-CTS/scripts/log/log_to_xml.py TestResults.qpa TestResults.xml
xsltproc VK-GL-CTS/doc/testlog-stylesheet/testlog.xsl TestResults.xml > TestResults.html
ln -s VK-GL-CTS/doc/testlog-stylesheet/testlog.css .
[ Your favorite browser here ] TestResults.html
To change what gets tested, modify the bottom of ci/run-tests.sh and/or ci/run-deqp.sh.
The results will be found in a new results/ dir in the virglrenderer source dir.
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment