blob: a1b537af8a9a5d1e28b7f02edafe9a4adbde8247 [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.
Mark Lobodzinski87220f82015-08-27 15:30:29 -06003Support for Windows is for the loader, layers, and the VkTrace trace/replay tools.
JensOwen95c62272014-11-01 13:05:43 -06004Support for Android is TBD.
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -06005
Cody Northrop043ea222015-05-26 15:51:12 -04006## Git the Bits
Courtney Goeltzenleuchter47469d92015-02-13 09:30:42 -07007
Dejan Mircevski8e672a02015-08-05 15:17:06 -04008Make sure you have access to the Khronos GitLab repository at gitlab.khronos.org. Once you do, the
9preferred work flow is to clone the repo, create a branch, push branch to gitlab and then
10issue a merge request to integrate that work back into the repo.
Courtney Goeltzenleuchter47469d92015-02-13 09:30:42 -070011
Cody Northrop043ea222015-05-26 15:51:12 -040012Note: 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).
Ian Elliotta3d55012015-02-13 10:57:55 -070013
Cody Northrop043ea222015-05-26 15:51:12 -040014## Linux System Requirements
Courtney Goeltzenleuchterfc82da62015-02-05 17:02:39 -070015Ubuntu 14.10 needed for DRI 3
Mike Stroyana768fc12014-10-30 15:59:54 -060016
JensOwenef271142014-11-01 13:11:50 -060017```
Dejan Mircevski8e672a02015-08-05 15:17:06 -040018sudo apt-get install git subversion cmake libgl1-mesa-dev freeglut3-dev libglm-dev libpng12-dev libmagickwand-dev qt5-default libpciaccess-dev libpthread-stubs0-dev libudev-dev
Mike Stroyana768fc12014-10-30 15:59:54 -060019sudo apt-get build-dep mesa
JensOwenef271142014-11-01 13:11:50 -060020```
Mark Lobodzinski87220f82015-08-27 15:30:29 -060021Warning: Recent versions of 14.10 have **REMOVED** DRI 3.
22Version: 2:2.99.914-1~exp1ubuntu4.1 is known to work.
Courtney Goeltzenleuchterfc82da62015-02-05 17:02:39 -070023To see status of this package:
24```
25dpkg -s xserver-xorg-video-intel
26```
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060027
Mark Lobodzinski87220f82015-08-27 15:30:29 -060028Note:
29Version 2:2.99.914-1~exp1ubuntu4.2 does not work anymore.
30To install the working driver from launchpadlibrarian.net:
31- Remove the current driver:
Norbert Nopper36ccff72015-02-06 21:06:58 +010032```
33sudo apt-get purge xserver-xorg-video-intel
34```
Mark Lobodzinski87220f82015-08-27 15:30:29 -060035- Download the old driver:
Norbert Nopper36ccff72015-02-06 21:06:58 +010036```
37wget http://launchpadlibrarian.net/189418339/xserver-xorg-video-intel_2.99.914-1%7Eexp1ubuntu4.1_amd64.deb
38```
39- Install the driver:
40```
41sudo dpkg -i xserver-xorg-video-intel_2.99.914-1~exp1ubuntu4.1_amd64.deb
42```
Mike Stroyancd2ab472015-03-23 17:36:54 -060043- Pin the package to prevent updates
44```
45sudo bash -c "echo $'Package: xserver-xorg-video-intel\nPin: version 2:2.99.914-1~exp1ubuntu4.1\nPin-Priority: 1001' > /etc/apt/preferences.d/xserver-xorg-video-intel"
46```
47
Mark Lobodzinski87220f82015-08-27 15:30:29 -060048- Either restart Ubuntu or just X11.
49
Courtney Goeltzenleuchter47469d92015-02-13 09:30:42 -070050## Clone the repository
51
52To create your local git repository:
53```
54mkdir YOUR_DEV_DIRECTORY # it's called GL-Next on Github, but the name doesn't matter
55cd YOUR_DEV_DIRECTORY
Dejan Mircevski8e672a02015-08-05 15:17:06 -040056git clone -o khronos git@gitlab.khronos.org:vulkan/LoaderAndTools.git .
57# Or substitute the URL from your forked repo for git@gitlab.khronos.org:vulkan/LoaderAndTools.git above.
Courtney Goeltzenleuchter47469d92015-02-13 09:30:42 -070058```
59
Cody Northrop043ea222015-05-26 15:51:12 -040060## Linux Build
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060061
Mike Stroyana768fc12014-10-30 15:59:54 -060062The sample driver uses cmake and should work with the usual cmake options and utilities.
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060063The standard build process builds the icd, the icd loader and all the tests.
64
65Example debug build:
JensOwenef271142014-11-01 13:11:50 -060066```
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060067cd YOUR_DEV_DIRECTORY # cd to the root of the vk git repository
Mike Stroyana768fc12014-10-30 15:59:54 -060068export KHRONOS_ACCOUNT_NAME= <subversion login name for svn checkout of BIL>
69./update_external_sources.sh # fetches and builds glslang, llvm, LunarGLASS, and BIL
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060070cmake -H. -Bdbuild -DCMAKE_BUILD_TYPE=Debug
71cd dbuild
72make
JensOwenef271142014-11-01 13:11:50 -060073```
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060074
Ian Elliottb626af02015-07-15 09:46:10 -060075To run VK programs you must tell the icd loader where to find the libraries.
76This is described in a specification in the Khronos documentation Git
77repository. See the file:
Peter Gal9ba151c2015-08-07 13:38:58 +020078https://gitlab.khronos.org/vulkan/vulkan/blob/master/ecosystem/LinuxICDs.txt
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060079
Ian Elliottb626af02015-07-15 09:46:10 -060080This specification describes both how ICDs and layers should be properly
81packaged, and how developers can point to ICDs and layers within their builds.
82
Courtney Goeltzenleuchter39af8ef2015-01-06 17:32:22 -070083
Cody Northrop043ea222015-05-26 15:51:12 -040084## Linux Test
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060085
Mike Stroyana768fc12014-10-30 15:59:54 -060086The test executibles can be found in the dbuild/tests directory. The tests use the Google
Norbert Nopper9652dfd2015-01-22 20:52:34 +010087gtest infrastructure. Tests available so far:
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -060088- vkbase: Test basic entry points
89- vk_blit_tests: Test VK Blits (copy, clear, and resolve)
90- vk_image_tests: Test VK image related calls needed by render_test
91- vk_render_tests: Render a single triangle with VK. Triangle will be in a .ppm in
Courtney Goeltzenleuchterb5fdda22014-09-01 18:05:45 -060092the current directory at the end of the test.
Dejan Mircevski8e672a02015-08-05 15:17:06 -040093- vk_layer_validation_tests: Test Vulkan layers.
94
95There are also a few shell and Python scripts that run test collections (eg,
96`run_all_tests.sh`).
Mike Stroyana768fc12014-10-30 15:59:54 -060097
Cody Northrop043ea222015-05-26 15:51:12 -040098## Linux Demos
Mike Stroyana768fc12014-10-30 15:59:54 -060099
JensOwen95c62272014-11-01 13:05:43 -0600100The demos executables can be found in the dbuild/demos directory. The demos use DRI 3
Mike Stroyana768fc12014-10-30 15:59:54 -0600101to render directly onto window surfaces.
Dejan Mircevski8e672a02015-08-05 15:17:06 -0400102- vulkaninfo: report GPU properties
Mike Stroyana768fc12014-10-30 15:59:54 -0600103- tri: a textured triangle
104- cube: a textured spinning cube
105
Cody Northrop043ea222015-05-26 15:51:12 -0400106## Linux Render Nodes
Mike Stroyana768fc12014-10-30 15:59:54 -0600107
108The render tests depend on access to DRM render nodes.
109To make that available, a couple of config files need to be created to set a module option
110and make accessible device files.
111The system will need to be rebooted with these files in place to complete initialization.
112These commands will create the config files.
113
JensOwenef271142014-11-01 13:11:50 -0600114```
Mike Stroyana768fc12014-10-30 15:59:54 -0600115sudo tee /etc/modprobe.d/drm.conf << EOF
JensOwenef271142014-11-01 13:11:50 -0600116# Enable render nodes
Mike Stroyana768fc12014-10-30 15:59:54 -0600117options drm rnodes=1
118EOF
Courtney Goeltzenleuchtera1099442015-01-07 17:46:53 -0700119# this will add the rnodes=1 option into the boot environment
120sudo update-initramfs -k all -u
JensOwen3ceb4752014-11-01 13:18:21 -0600121```
122```
Mike Stroyana768fc12014-10-30 15:59:54 -0600123sudo tee /etc/udev/rules.d/drm.rules << EOF
JensOwenef271142014-11-01 13:11:50 -0600124# Add permissions to render nodes
Mike Stroyana768fc12014-10-30 15:59:54 -0600125SUBSYSTEM=="drm", ACTION=="add", DEVPATH=="/devices/*/renderD*", MODE="020666"
126EOF
JensOwenef271142014-11-01 13:11:50 -0600127```
Ian Elliott40e7dd92015-02-05 12:22:51 -0700128
Cody Northrop043ea222015-05-26 15:51:12 -0400129## Windows System Requirements
Ian Elliott40e7dd92015-02-05 12:22:51 -0700130
Ian Elliott8ebc3552015-07-08 15:43:03 -0600131Windows 7+ with additional required software packages:
Ian Elliott40e7dd92015-02-05 12:22:51 -0700132
133- Microsoft Visual Studio 2013 Professional. Note: it is possible that lesser/older versions may work, but that has not been tested.
Ian Elliott40fb02f2015-03-06 11:37:07 -0700134- CMake (from http://www.cmake.org/download/). Notes:
Mark Lobodzinski87220f82015-08-27 15:30:29 -0600135 - In order to build the VkTrace tools, you need at least version 3.0.
Ian Elliott40fb02f2015-03-06 11:37:07 -0700136 - Tell the installer to "Add CMake to the system PATH" environment variable.
137- Python 3 (from https://www.python.org/downloads). Notes:
138 - Select to install the optional sub-package to add Python to the system PATH environment variable.
Mark Lobodzinski87220f82015-08-27 15:30:29 -0600139 - Need python3.3 or later to get the Windows py.exe launcher that is used to get python3 rather than python2 if both are installed on Windows
Ian Elliott3ef2dfd2015-07-08 14:33:52 -0600140- Git (from http://git-scm.com/download/win).
141 - Note: If you use Cygwin, you can normally use Cygwin's "git.exe". However, in order to use the "update_external_sources.bat" script, you must have this version.
142 - Tell the installer to allow it to be used for "Developer Prompt" as well as "Git Bash".
143 - Tell the installer to treat line endings "as is" (i.e. both DOS and Unix-style line endings).
144- Image Magick is used by the tests to compare images (from http://www.imagemagick.org/script/binary-releases.php)
145 - Be sure to check box to "Install development headers and libraries"
146- glslang is required for demos and tests.
147 - You can download and configure it (in a peer directory) here: https://github.com/KhronosGroup/glslang/blob/master/README.md
148 - A windows batch file has been included that will pull and build the correct version. Run it from Developer Command Prompt for VS2013 like so:
149 - update_external_sources.bat --build-glslang
150
Ian Elliott8ebc3552015-07-08 15:43:03 -0600151Optional software packages:
152
Ian Elliott8ebc3552015-07-08 15:43:03 -0600153- Cygwin (from https://www.cygwin.com/). Notes:
154 - Cygwin provides some Linux-like tools, which are valuable for obtaining the source code, and running CMake.
155 Especially valuable are the BASH shell and git packages.
156 - If you don't want to use Cygwin, there are other shells and environments that can be used.
157 You can also use a Git package that doesn't come from Cygwin.
Ian Elliott40e7dd92015-02-05 12:22:51 -0700158
Cody Northrop043ea222015-05-26 15:51:12 -0400159## Windows Build
Ian Elliott40e7dd92015-02-05 12:22:51 -0700160
161Cygwin 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.
162
Ian Elliott8ebc3552015-07-08 15:43:03 -0600163Example debug build (e.g. in a "Developer Command Prompt for VS2013" window):
Ian Elliott40e7dd92015-02-05 12:22:51 -0700164```
Ian Elliott8ebc3552015-07-08 15:43:03 -0600165cd LoaderAndTools # cd to the root of the Vulkan git repository
166update_external_sources.bat --build-glslang
Ian Elliott40e7dd92015-02-05 12:22:51 -0700167mkdir _out64
168cd _out64
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700169cmake -G "Visual Studio 12 Win64" -DCMAKE_BUILD_TYPE=Debug ..
Ian Elliott40e7dd92015-02-05 12:22:51 -0700170```
171
Cody Northrop043ea222015-05-26 15:51:12 -0400172At this point, you can use Windows Explorer to launch Visual Studio by double-clicking on the "VULKAN.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.
Ian Elliott40e7dd92015-02-05 12:22:51 -0700173
Courtney Goeltzenleuchter9cc421e2015-04-08 15:36:08 -0600174VK programs must be able to find and use the VK.dll libary. Make sure it is either installed in the C:\Windows\System32 folder, or the PATH enviroment variable includes the folder that it is located in.
David Pinedo8e9cb3b2015-02-10 15:02:08 -0700175
Ian Elliottb626af02015-07-15 09:46:10 -0600176To run VK programs you must tell the icd loader where to find the libraries.
177This is described in a specification in the Khronos documentation Git
178repository. See the file:
Peter Gal9ba151c2015-08-07 13:38:58 +0200179https://gitlab.khronos.org/vulkan/vulkan/blob/master/ecosystem/WindowsICDs.txt
Ian Elliott225188f2015-02-17 10:33:47 -0700180
Ian Elliottb626af02015-07-15 09:46:10 -0600181This specification describes both how ICDs and layers should be properly
182packaged, and how developers can point to ICDs and layers within their builds.