Vulkan with Intel Graphics on Ubuntu 14.04
I've been hacking away, trying to get Vulkan working on my Ubuntu 14.04 laptop (Late-2013 MacBook Pro [11,2]). It's more or less working.
vulkaninfo appears to complete without error, and both the LunarG example programs run, though with a number of warnings. At this point the problem is just that the vulkan driver is not finished for my hardware (Haswell).
Here are the steps I took to get some almost-working drivers.
- Install LunarG's Vulkan SDK
- Update to Linux Kernel 4.2 via the Ubuntu 14.04 LTS Enablement Stack
- Enable DRI3 by copying
- Reboot and make sure that DRI3 is now mentioned in
- Checkout the vulkan branch of the mesa source code with
git clone -b vulkan http://anongit.freedesktop.org/git/mesa/mesa.git
- The newest versions depend on a slightly newer version of libdrm than comes with 14.04, so roll back the repository back to the latest working driver version with
git reset --hard b83785d86d2c7f07323920615c72a9f09695a9a7
- Apply the patch supplied below with
git apply fix-missing-memfd-header.patchto correct for the missing memfd headers.
- Install build dependencies listed on the mesa website. I think
sudo apt-get install python-mako bison flex build-essential autoconfcovers everything that's needed.
- Check the README in the mesa repository for up-to-date build instructions. At time of this writing, you can build with
autoreconf -vfi && ./configure --with-dri-drivers=i965 --with-gallium-drivers= && make -j4. You can add
--enable-debugto configure if you want a build that will print more detailed vkError messages.
- I hacked around a permissions problem by running
sudo chmod 666 /dev/dri/renderD128. Apparently there is supposed to be a script that adds your user to an access control list (ACL) on login. That doesn't seem to exist on Ubuntu 14.04, though.
VK_ICD_FILENAMESso the LunarG loader finds everything correctly. You'll need to do this in the same shell that runs your program.
README.intel-vulkan.txtgives you a command, but it refers to a non-existent file. Instead use
export VK_ICD_FILENAMES="$MESA_TOP/src/intel/vulkan/dev_icd.json", replacing
$MESA_TOPwith the absolute path of the directory containing the mesa source code.
- You're done! Run
vulkaninfoand/or try to run the VulkanSDK example
cube. Instructions to build and run the latter are on the LunarG website.
My vulkaninfo and cube output are here for reference.