This project fully supports Linux and Windows today. Support for Android is TBD.
Make sure you have access to the Khronos GitLab repository at gitlab.khronos.org. Once you do, the preferred work flow is to clone the repo, create a branch, push branch to gitlab and then issue a merge request to integrate that work back into the repo.
Note: If you are doing ICD (driver) development, please make sure to look at documentation in the ICD Loader and the Sample Driver.
Ubuntu 14.04.3 LTS, 14.10, 15.04 and 15.10 have been used with the sample driver.
These packages are used for building and running the samples.
sudo apt-get install git subversion cmake libgl1-mesa-dev freeglut3-dev libglm-dev qt5-default libpciaccess-dev libpthread-stubs0-dev libudev-dev bison graphviz libpng-dev sudo apt-get build-dep mesa
The sample driver uses DRI3 for its window system interface. That requires extra configuration of Ubuntu systems.
Ubuntu 14.04.3 LTS does not ship a xserver-xorg-video-intel package with supported DRI 3 on intel graphics. The xserver-xorg-video-intel package can be built from source with DRI 3 enabled. Use the following commands to enable DRI3 on ubuntu 14.04.3 LTS.
sudo apt-get update sudo apt-get dist-upgrade sudo apt-get install devscripts sudo apt-get build-dep xserver-xorg-video-intel-lts-vivid
mkdir xserver-xorg-video-intel-lts-vivid_source cd xserver-xorg-video-intel-lts-vivid_source apt-get source xserver-xorg-video-intel-lts-vivid cd xserver-xorg-video-intel-lts-vivid-2.99.917 debian/rules patch quilt new 'enable-DRI3' quilt edit configure.ac
--- a/configure.ac +++ b/configure.ac @@ -340,9 +340,9 @@ [DRI2=yes]) AC_ARG_ENABLE(dri3, AS_HELP_STRING([--enable-dri3], - [Enable DRI3 support [[default=no]]]), + [Enable DRI3 support [[default=yes]]]), [DRI3=$enableval], - [DRI3=no]) + [DRI3=yes]) AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Disable XvMC support [[default=yes]]]),
quilt refresh debian/rules clean debuild -us -uc sudo dpkg -i ../xserver-xorg-video-intel-lts-vivid_2.99.917-1~exp1ubuntu2.2~trusty1_amd64.deb
sudo bash -c 'echo xserver-xorg-video-intel-lts-vivid hold | dpkg --set-selections'
sudo service lightdm restart
xdpyinfo | grep DRI
Warning: Recent versions of 14.10 have REMOVED DRI 3. Version: 2:2.99.914-1~exp1ubuntu4.1 is known to work. To see status of this package:
dpkg -s xserver-xorg-video-intel
Note: Version 2:2.99.914-1~exp1ubuntu4.2 does not work anymore. To install the working driver from launchpadlibrarian.net:
sudo apt-get purge xserver-xorg-video-intel
wget http://launchpadlibrarian.net/189418339/xserver-xorg-video-intel_2.99.914-1%7Eexp1ubuntu4.1_amd64.deb
sudo dpkg -i xserver-xorg-video-intel_2.99.914-1~exp1ubuntu4.1_amd64.deb
sudo 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"
Ubuntu 15.04 has never shipped a xserver-xorg-video-intel package with supported DRI 3 on intel graphics. The xserver-xorg-video-intel package can be built from source with DRI 3 enabled. Use the following commands to enable DRI3 on ubuntu 15.04.
sudo apt-get update sudo apt-get dist-upgrade sudo apt-get install devscripts sudo apt-get build-dep xserver-xorg-video-intel
mkdir xserver-xorg-video-intel_source cd xserver-xorg-video-intel_source apt-get source xserver-xorg-video-intel cd xserver-xorg-video-intel-2.99.917 debian/rules patch quilt new 'enable-DRI3' quilt edit configure.ac
--- a/configure.ac +++ b/configure.ac @@ -340,9 +340,9 @@ [DRI2=yes]) AC_ARG_ENABLE(dri3, AS_HELP_STRING([--enable-dri3], - [Enable DRI3 support [[default=no]]]), + [Enable DRI3 support [[default=yes]]]), [DRI3=$enableval], - [DRI3=no]) + [DRI3=yes]) AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Disable XvMC support [[default=yes]]]),
quilt refresh debian/rules clean debuild -us -uc sudo dpkg -i ../xserver-xorg-video-intel_2.99.917-1~exp1ubuntu2.2_amd64.deb
sudo bash -c 'echo xserver-xorg-video-intel hold | dpkg --set-selections'
sudo service lightdm restart
xdpyinfo | grep DRI
Ubuntu 15.10 has never shipped a xserver-xorg-video-intel package with supported DRI 3 on intel graphics. The xserver-xorg-video-intel package can be built from source with DRI 3 enabled. Use the following commands to enable DRI3 on ubuntu 15.10.
sudo apt-get update sudo apt-get dist-upgrade sudo apt-get install devscripts sudo apt-get build-dep xserver-xorg-video-intel
mkdir xserver-xorg-video-intel_source cd xserver-xorg-video-intel_source apt-get source xserver-xorg-video-intel cd xserver-xorg-video-intel-2.99.917+git20150808 debian/rules patch quilt new 'enable-DRI3' quilt edit configure.ac
Index: xserver-xorg-video-intel-2.99.917+git20150808/configure.ac =================================================================== --- xserver-xorg-video-intel-2.99.917+git20150808.orig/configure.ac +++ xserver-xorg-video-intel-2.99.917+git20150808/configure.ac @@ -356,7 +356,7 @@ AC_ARG_WITH(default-dri, AS_HELP_STRING([--with-default-dri], [Select the default maximum DRI level [default 2]]), [DRI_DEFAULT=$withval], - [DRI_DEFAULT=2]) + [DRI_DEFAULT=3]) if test "x$DRI_DEFAULT" = "x0"; then AC_DEFINE(DEFAULT_DRI_LEVEL, 0,[Default DRI level]) else
quilt refresh debian/rules clean debuild -us -uc sudo dpkg -i ../xserver-xorg-video-intel_2.99.917+git20150808-0ubuntu4_amd64.deb
sudo bash -c 'echo xserver-xorg-video-intel hold | dpkg --set-selections'
sudo service lightdm restart
xdpyinfo | grep DRI
To create your local git repository:
mkdir YOUR_DEV_DIRECTORY # it's called GL-Next on Github, but the name doesn't matter cd YOUR_DEV_DIRECTORY git clone -o khronos git@gitlab.khronos.org:vulkan/LoaderAndTools.git . # Or substitute the URL from your forked repo for git@gitlab.khronos.org:vulkan/LoaderAndTools.git above.
The sample driver uses cmake and should work with the usual cmake options and utilities. The standard build process builds the icd, the icd loader and all the tests.
Example debug build:
cd YOUR_DEV_DIRECTORY # cd to the root of the vk git repository export KHRONOS_ACCOUNT_NAME= <subversion login name for svn checkout of BIL> ./update_external_sources.sh # fetches and builds glslang, llvm, LunarGLASS, and BIL cmake -H. -Bdbuild -DCMAKE_BUILD_TYPE=Debug cd dbuild make
To run VK programs you must tell the icd loader where to find the libraries. This is described in a specification in the Khronos documentation Git repository. See the file: https://gitlab.khronos.org/vulkan/vulkan/blob/master/ecosystem/LinuxICDs.txt
This specification describes both how ICDs and layers should be properly packaged, and how developers can point to ICDs and layers within their builds.
The test executibles can be found in the dbuild/tests directory. The tests use the Google gtest infrastructure. Tests available so far:
There are also a few shell and Python scripts that run test collections (eg, run_all_tests.sh
).
The demos executables can be found in the dbuild/demos directory. The demos use DRI 3 to render directly onto window surfaces.
Windows 7+ with additional required software packages:
Optional software packages:
Cygwin 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.
Example debug x64 build (e.g. in a "Developer Command Prompt for VS2013" window):
cd LoaderAndTools # cd to the root of the Vulkan git repository update_external_sources.bat --all mkdir build cd build cmake -G "Visual Studio 12 Win64" ..
At this point, you can use Windows Explorer to launch Visual Studio by double-clicking on the "VULKAN.sln" file in the \build 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 "build" folder.
VK 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.
To run VK programs you must tell the icd loader where to find the libraries. This is described in a specification in the Khronos documentation Git repository. See the file: https://gitlab.khronos.org/vulkan/vulkan/blob/master/ecosystem/WindowsICDs.txt
This specification describes both how ICDs and layers should be properly packaged, and how developers can point to ICDs and layers within their builds.
If you plan on creating a Windows Install file (done in the windowsRuntimeInstaller sub-directory) you will need to build for both 32-bit and 64-bit Windows since both versions of EXEs and DLLs exist simultaneously on Windows 64.
To do this, simply create and build the release versions of each target:
cd LoaderAndTools # cd to the root of the Vulkan git repository update_external_sources.bat --all mkdir build cd build cmake -G "Visual Studio 12 Win64" .. msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release mkdir build32 cd build32 cmake -G "Visual Studio 12" .. msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release