blob: bef5b6d467906fab97b858f3eb773af038c8e77b [file] [log] [blame] [view]
JensOwen95c62272014-11-01 13:05:43 -06001# Build Instructions
Ian Elliott40e7dd92015-02-05 12:22:51 -07002This project fully supports Linux today.
3Support for Windows is for the loader and layers (additional info below). Additional Windows support will be coming in Q1'15.
JensOwen95c62272014-11-01 13:05:43 -06004Support for Android is TBD.
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -06005
Ian Elliotta3d55012015-02-13 10:57:55 -07006Note: If you are doing ICD (driver) development, please make sure to look at documentation in the [*ICD Loader*](loader/README.md) and the [*Sample Driver*](icd).
7
Ian Elliott40e7dd92015-02-05 12:22:51 -07008##Linux System Requirements
Courtney Goeltzenleuchterfc82da62015-02-05 17:02:39 -07009Ubuntu 14.10 needed for DRI 3
Mike Stroyana768fc12014-10-30 15:59:54 -060010
JensOwenef271142014-11-01 13:11:50 -060011```
Norbert Nopper86647a92015-01-22 20:47:49 +010012sudo apt-get install git subversion cmake libgl1-mesa-dev freeglut3-dev libglm-dev libpng12-dev libmagickwand-dev qt5-default
Mike Stroyana768fc12014-10-30 15:59:54 -060013sudo apt-get build-dep mesa
JensOwenef271142014-11-01 13:11:50 -060014```
Courtney Goeltzenleuchterfc82da62015-02-05 17:02:39 -070015Warning: Recent versions of 14.10 have **REMOVED** DRI 3.
16Version: 2:2.99.914-1~exp1ubuntu4.1 is known to work.
17To see status of this package:
18```
19dpkg -s xserver-xorg-video-intel
20```
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060021
Norbert Nopper455f25d2015-02-06 20:57:52 +010022Note:
23Version 2:2.99.914-1~exp1ubuntu4.2 does not work anymore.
24To install the working driver from launchpadlibrarian.net:
Norbert Nopper36ccff72015-02-06 21:06:58 +010025- Remove the current driver:
26```
27sudo apt-get purge xserver-xorg-video-intel
28```
29- Download the old driver:
30```
31wget http://launchpadlibrarian.net/189418339/xserver-xorg-video-intel_2.99.914-1%7Eexp1ubuntu4.1_amd64.deb
32```
33- Install the driver:
34```
35sudo dpkg -i xserver-xorg-video-intel_2.99.914-1~exp1ubuntu4.1_amd64.deb
36```
37- Either restart Ubuntu or just X11.
Norbert Nopper455f25d2015-02-06 20:57:52 +010038
Ian Elliott40e7dd92015-02-05 12:22:51 -070039##Linux Build
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060040
Mike Stroyana768fc12014-10-30 15:59:54 -060041The sample driver uses cmake and should work with the usual cmake options and utilities.
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060042The standard build process builds the icd, the icd loader and all the tests.
43
44Example debug build:
JensOwenef271142014-11-01 13:11:50 -060045```
Jens Owen38dcdf12015-02-12 15:38:13 -070046cd GL-Next # cd to the root of the xgl git repository
Mike Stroyana768fc12014-10-30 15:59:54 -060047export KHRONOS_ACCOUNT_NAME= <subversion login name for svn checkout of BIL>
48./update_external_sources.sh # fetches and builds glslang, llvm, LunarGLASS, and BIL
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060049cmake -H. -Bdbuild -DCMAKE_BUILD_TYPE=Debug
50cd dbuild
51make
JensOwenef271142014-11-01 13:11:50 -060052```
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060053
54To run XGL programs you must tell the icd loader where to find the libraries. Set the
55environment variable LIBXGL_DRIVERS_PATH to the driver path. For example:
JensOwenef271142014-11-01 13:11:50 -060056```
Mike Stroyana768fc12014-10-30 15:59:54 -060057export LIBXGL_DRIVERS_PATH=$PWD/icd/intel
JensOwenef271142014-11-01 13:11:50 -060058```
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060059
Courtney Goeltzenleuchter39af8ef2015-01-06 17:32:22 -070060To enable debug and validation layers with your XGL programs you must tell the icd loader
61where to find the layer libraries. Set the environment variable LIBXGL_LAYERS_PATH to
62the layer folder and indicate the layers you want loaded via LIBXGL_LAYER_NAMES.
63For example, to enable the APIDump and DrawState layers, do:
64```
65export LIBXGL_LAYERS_PATH=$PWD/layers
66export LIBXGL_LAYER_NAMES=APIDump:DrawState
67```
68
Ian Elliott40e7dd92015-02-05 12:22:51 -070069##Linux Test
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060070
Mike Stroyana768fc12014-10-30 15:59:54 -060071The test executibles can be found in the dbuild/tests directory. The tests use the Google
Norbert Nopper9652dfd2015-01-22 20:52:34 +010072gtest infrastructure. Tests available so far:
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060073- xglinfo: Report GPU properties
74- xglbase: Test basic entry points
Mike Stroyana768fc12014-10-30 15:59:54 -060075- xgl_blit_tests: Test XGL Blits (copy, clear, and resolve)
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060076- xgl_image_tests: Test XGL image related calls needed by render_test
77- xgl_render_tests: Render a single triangle with XGL. Triangle will be in a .ppm in
78the current directory at the end of the test.
Mike Stroyana768fc12014-10-30 15:59:54 -060079
Ian Elliott40e7dd92015-02-05 12:22:51 -070080##Linux Demos
Mike Stroyana768fc12014-10-30 15:59:54 -060081
JensOwen95c62272014-11-01 13:05:43 -060082The demos executables can be found in the dbuild/demos directory. The demos use DRI 3
Mike Stroyana768fc12014-10-30 15:59:54 -060083to render directly onto window surfaces.
84- tri: a textured triangle
85- cube: a textured spinning cube
86
Ian Elliott40e7dd92015-02-05 12:22:51 -070087##Linux Render Nodes
Mike Stroyana768fc12014-10-30 15:59:54 -060088
89The render tests depend on access to DRM render nodes.
90To make that available, a couple of config files need to be created to set a module option
91and make accessible device files.
92The system will need to be rebooted with these files in place to complete initialization.
93These commands will create the config files.
94
JensOwenef271142014-11-01 13:11:50 -060095```
Mike Stroyana768fc12014-10-30 15:59:54 -060096sudo tee /etc/modprobe.d/drm.conf << EOF
JensOwenef271142014-11-01 13:11:50 -060097# Enable render nodes
Mike Stroyana768fc12014-10-30 15:59:54 -060098options drm rnodes=1
99EOF
Courtney Goeltzenleuchtera1099442015-01-07 17:46:53 -0700100# this will add the rnodes=1 option into the boot environment
101sudo update-initramfs -k all -u
JensOwen3ceb4752014-11-01 13:18:21 -0600102```
103```
Mike Stroyana768fc12014-10-30 15:59:54 -0600104sudo tee /etc/udev/rules.d/drm.rules << EOF
JensOwenef271142014-11-01 13:11:50 -0600105# Add permissions to render nodes
Mike Stroyana768fc12014-10-30 15:59:54 -0600106SUBSYSTEM=="drm", ACTION=="add", DEVPATH=="/devices/*/renderD*", MODE="020666"
107EOF
JensOwenef271142014-11-01 13:11:50 -0600108```
Ian Elliott40e7dd92015-02-05 12:22:51 -0700109
110##Windows System Requirements
111
112Windows 7+ with additional, software:
113
114- Microsoft Visual Studio 2013 Professional. Note: it is possible that lesser/older versions may work, but that has not been tested.
Ian Elliotta3d55012015-02-13 10:57:55 -0700115- CMake (from http://www.cmake.org/cmake/resources/software.html). Note: Configure to add itself to the system PATH environment variable.
Ian Elliott40e7dd92015-02-05 12:22:51 -0700116- Python 3 (from https://www.python.org/downloads). Note: Configure to add itself to the system PATH environment variable.
117- Cygwin (especially a BASH shell and git packages--from https://www.cygwin.com/).
118
119##Windows Build
120
121Cygwin is used in order to obtain a local copy of the Git repository, and to run the CMake command that creates Visual Studio files. Visual Studio is used to build the software, and will re-run CMake as appropriate.
122
123Example debug build:
124```
125cd GL-Next # cd to the root of the xgl git repository
126mkdir _out64
127cd _out64
128cmake -G "Visual Studio 12 Win64" ..
129```
130
131At this point, you can use Windows Explorer to launch Visual Studio by double-clicking on the "XGL.sln" file in the _out64 folder. Once Visual Studio comes up, you can select "Debug" or "Release" from a drop-down list. You can start a build with either the menu (Build->Build Solution), or a keyboard shortcut (Ctrl+Shift+B). As part of the build process, Python scripts will create additional Visual Studio files and projects, along with additional source files. All of these auto-generated files are under the "_out64" folder.
132
133To run XGL programs you must have an appropriate icd (installable client driver) that is either installed in the C:\Windows\System32 folder, or pointed to by the
134environment variable LIBXGL_DRIVERS_PATH. This environment variable cannot be set with Cygwin, but must be set via Windows, and may require a system restart in order for it to take effect. Here is how to set this environment variable on a Windows 7 system:
135
136- Launch Control Panel (e.g. Start->Control Panel)
137- Within the search box, type "environment variable" and click on "Edit the system environment variables" (or navigate there via "System and Security->System->Advanced system settings").
138- This will launch a window with several tabs, one of which is "Advanced". Click on the "Environment Variables..." button.
139- For either "User variables" or "System variables" click "New...".
140- Enter "LIBXGL_DRIVERS_PATH" as the variable name, and an appropriate Windows path to where your driver DLL is (e.g. C:\Users\username\GL-Next\_out64\icd\drivername\Debug).
141
142It is possible to specify multiple icd folders. Simply use a semi-colon (i.e. ";") to separate folders in the environment variable.
143
144The icd loader searches in all of the folders for files that are named "XGL_*.dll" (e.g. "XGL_foo.dll"). It attempts to dynamically load these files, and look for appropriate functions.
145
146To enable debug and validation layers with your XGL programs you must tell the icd loader
147where to find the layer libraries, and which ones you desire to use. The default folder for layers is C:\Windows\System32. However, you can use the following environment variables to specify alternate locations, and to specify which layers to use:
148
149- LIBXGL_LAYERS_PATH (semi-colon-delimited set of folders to look for layers)
150- LIBXGL_LAYER_NAMES (color-delimited list of layer names)
151
152For example, to enable the APIDump and DrawState layers, set:
153
154- "LIBXGL_LAYERS_PATH" to "C:\Users\username\GL-Next\_out64\layers\Debug"
155- "LIBXGL_LAYER_NAMES to "APIDump:DrawState"
156
157The icd loader searches in all of the folders for files that are named "XGLLayer*.dll" (e.g. "XGLLayerParamChecker.dll"). It attempts to dynamically load these files, and look for appropriate functions.