blob: 1604d6aa528c10d90826e7a0fca4cf2bf8cf7541 [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 Elliott40e7dd92015-02-05 12:22:51 -07006##Linux System Requirements
Courtney Goeltzenleuchterfc82da62015-02-05 17:02:39 -07007Ubuntu 14.10 needed for DRI 3
Mike Stroyana768fc12014-10-30 15:59:54 -06008
JensOwenef271142014-11-01 13:11:50 -06009```
Norbert Nopper86647a92015-01-22 20:47:49 +010010sudo 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 -060011sudo apt-get build-dep mesa
JensOwenef271142014-11-01 13:11:50 -060012```
Courtney Goeltzenleuchterfc82da62015-02-05 17:02:39 -070013Warning: Recent versions of 14.10 have **REMOVED** DRI 3.
14Version: 2:2.99.914-1~exp1ubuntu4.1 is known to work.
15To see status of this package:
16```
17dpkg -s xserver-xorg-video-intel
18```
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060019
Ian Elliott40e7dd92015-02-05 12:22:51 -070020##Linux Build
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060021
Mike Stroyana768fc12014-10-30 15:59:54 -060022The sample driver uses cmake and should work with the usual cmake options and utilities.
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060023The standard build process builds the icd, the icd loader and all the tests.
24
25Example debug build:
JensOwenef271142014-11-01 13:11:50 -060026```
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060027cd xgl # cd to the root of the xgl git repository
Mike Stroyana768fc12014-10-30 15:59:54 -060028export KHRONOS_ACCOUNT_NAME= <subversion login name for svn checkout of BIL>
29./update_external_sources.sh # fetches and builds glslang, llvm, LunarGLASS, and BIL
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060030cmake -H. -Bdbuild -DCMAKE_BUILD_TYPE=Debug
31cd dbuild
32make
JensOwenef271142014-11-01 13:11:50 -060033```
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060034
35To run XGL programs you must tell the icd loader where to find the libraries. Set the
36environment variable LIBXGL_DRIVERS_PATH to the driver path. For example:
JensOwenef271142014-11-01 13:11:50 -060037```
Mike Stroyana768fc12014-10-30 15:59:54 -060038export LIBXGL_DRIVERS_PATH=$PWD/icd/intel
JensOwenef271142014-11-01 13:11:50 -060039```
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060040
Courtney Goeltzenleuchter39af8ef2015-01-06 17:32:22 -070041To enable debug and validation layers with your XGL programs you must tell the icd loader
42where to find the layer libraries. Set the environment variable LIBXGL_LAYERS_PATH to
43the layer folder and indicate the layers you want loaded via LIBXGL_LAYER_NAMES.
44For example, to enable the APIDump and DrawState layers, do:
45```
46export LIBXGL_LAYERS_PATH=$PWD/layers
47export LIBXGL_LAYER_NAMES=APIDump:DrawState
48```
49
Ian Elliott40e7dd92015-02-05 12:22:51 -070050##Linux Test
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060051
Mike Stroyana768fc12014-10-30 15:59:54 -060052The test executibles can be found in the dbuild/tests directory. The tests use the Google
Norbert Nopper9652dfd2015-01-22 20:52:34 +010053gtest infrastructure. Tests available so far:
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060054- xglinfo: Report GPU properties
55- xglbase: Test basic entry points
Mike Stroyana768fc12014-10-30 15:59:54 -060056- xgl_blit_tests: Test XGL Blits (copy, clear, and resolve)
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060057- xgl_image_tests: Test XGL image related calls needed by render_test
58- xgl_render_tests: Render a single triangle with XGL. Triangle will be in a .ppm in
59the current directory at the end of the test.
Mike Stroyana768fc12014-10-30 15:59:54 -060060
Ian Elliott40e7dd92015-02-05 12:22:51 -070061##Linux Demos
Mike Stroyana768fc12014-10-30 15:59:54 -060062
JensOwen95c62272014-11-01 13:05:43 -060063The demos executables can be found in the dbuild/demos directory. The demos use DRI 3
Mike Stroyana768fc12014-10-30 15:59:54 -060064to render directly onto window surfaces.
65- tri: a textured triangle
66- cube: a textured spinning cube
67
Ian Elliott40e7dd92015-02-05 12:22:51 -070068##Linux Render Nodes
Mike Stroyana768fc12014-10-30 15:59:54 -060069
70The render tests depend on access to DRM render nodes.
71To make that available, a couple of config files need to be created to set a module option
72and make accessible device files.
73The system will need to be rebooted with these files in place to complete initialization.
74These commands will create the config files.
75
JensOwenef271142014-11-01 13:11:50 -060076```
Mike Stroyana768fc12014-10-30 15:59:54 -060077sudo tee /etc/modprobe.d/drm.conf << EOF
JensOwenef271142014-11-01 13:11:50 -060078# Enable render nodes
Mike Stroyana768fc12014-10-30 15:59:54 -060079options drm rnodes=1
80EOF
Courtney Goeltzenleuchtera1099442015-01-07 17:46:53 -070081# this will add the rnodes=1 option into the boot environment
82sudo update-initramfs -k all -u
JensOwen3ceb4752014-11-01 13:18:21 -060083```
84```
Mike Stroyana768fc12014-10-30 15:59:54 -060085sudo tee /etc/udev/rules.d/drm.rules << EOF
JensOwenef271142014-11-01 13:11:50 -060086# Add permissions to render nodes
Mike Stroyana768fc12014-10-30 15:59:54 -060087SUBSYSTEM=="drm", ACTION=="add", DEVPATH=="/devices/*/renderD*", MODE="020666"
88EOF
JensOwenef271142014-11-01 13:11:50 -060089```
Ian Elliott40e7dd92015-02-05 12:22:51 -070090
91##Windows System Requirements
92
93Windows 7+ with additional, software:
94
95- Microsoft Visual Studio 2013 Professional. Note: it is possible that lesser/older versions may work, but that has not been tested.
96- CMake (from https://www.python.org/downloads). Note: Configure to add itself to the system PATH environment variable.
97- Python 3 (from https://www.python.org/downloads). Note: Configure to add itself to the system PATH environment variable.
98- Cygwin (especially a BASH shell and git packages--from https://www.cygwin.com/).
99
100##Windows Build
101
102Cygwin 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.
103
104Example debug build:
105```
106cd GL-Next # cd to the root of the xgl git repository
107mkdir _out64
108cd _out64
109cmake -G "Visual Studio 12 Win64" ..
110```
111
112At 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.
113
114To 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
115environment 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:
116
117- Launch Control Panel (e.g. Start->Control Panel)
118- 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").
119- This will launch a window with several tabs, one of which is "Advanced". Click on the "Environment Variables..." button.
120- For either "User variables" or "System variables" click "New...".
121- 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).
122
123It is possible to specify multiple icd folders. Simply use a semi-colon (i.e. ";") to separate folders in the environment variable.
124
125The 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.
126
127To enable debug and validation layers with your XGL programs you must tell the icd loader
128where 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:
129
130- LIBXGL_LAYERS_PATH (semi-colon-delimited set of folders to look for layers)
131- LIBXGL_LAYER_NAMES (color-delimited list of layer names)
132
133For example, to enable the APIDump and DrawState layers, set:
134
135- "LIBXGL_LAYERS_PATH" to "C:\Users\username\GL-Next\_out64\layers\Debug"
136- "LIBXGL_LAYER_NAMES to "APIDump:DrawState"
137
138The 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.