Skip to content

Instantly share code, notes, and snippets.

@SaschaWillems
Last active September 26, 2018 22:09
Show Gist options
  • Save SaschaWillems/47be6970a3e99a3d30e1 to your computer and use it in GitHub Desktop.
Save SaschaWillems/47be6970a3e99a3d30e1 to your computer and use it in GitHub Desktop.
Intel Vulkan Mesa on Ubuntu 15.10
# Pre requisites
- Enable DRI3 as described in https://vulkan.lunarg.com/app/docs/v1.0.3.1/getting_started_linux
- Install a library for SHA, e.g. sudo apt-get install libgcrypt11-dev (if not already present)
- Otherwise the driver may throw an error with "_mesa_sha1_compute" when loading SPIR-V shaders
# Building
- Clone Mesa Master : git clone git://anongit.freedesktop.org/mesa/mesa -b Master
- cd mesa
- autoreconf -vfi
- ./configure --with-dri-drivers=i965 --with-gallium-drivers= --with-sha1= --with-vulkan-drivers=intel
- make
# Setting up the loader
- Create the directory /usr/share/vulkan/icd.d
- This is the place where the loader searches for installed ICDs
- From the mesa directory
- Copy intel_icd.json /src/intel/vulkan to /usr/share/vulkan/icd.d
- Copy libvulkan_intel.so from /lib to /usr/share/vulkan/icd.d
# Verify
- Run vulkaninfo > vulkaninfo.txt
- Check for the following line :
- INFO: [loader] Code 0 : Found manifest file /usr/share/vulkan/icd.d/intel_icd.json, version "1.0.0"
- If this line is not followed by an "error", the icd has been located by the loader
- Run vulkaninfo | grep deviceName
- This should return the name of your device, e.g. "Intel(R) Ivybridge Mobile"
@rootext
Copy link

rootext commented Mar 8, 2016

Hi, thank you for tutorial.
Finally, I've understood why vulkan driver doesn't work on my laptop.
I built it with --enable-debug and got the exact error:
anv_device.c:66: failed to open /dev/dri/renderD128: No such file or directory (VK_ERROR_INITIALIZATION_FAILED) /home/jeremy/Development/LunarG/Vulkan/LinuxSDK/LoaderAndValidationLayers/demos/vulkaninfo.c:1183: failed with VK_ERROR_INITIALIZATION_FAILED
There is no /dev/dri/renderD128 in my system. I have only /dev/dri/card0.
I found that it is a DRM Render node. However, I wasn't able to find how to get this device.
Could you please give advice how to fix it? What is a version of linux kernel is on your machine?
Thanks in advance.

@SaschaWillems
Copy link
Author

I'm on Ubunto 15.10 which is Kernel 4.2.

Do you have multiple devices installed? If not, you may be right with the DRM assumption. The earlier Vulkan SDKs included an Intel ICD and you had to manually add some DRM stuff to use, but that info is no longer present in the docs for the current SDK.

I'll check if I can find this paragraph in one of the older SDKs.

@rootext
Copy link

rootext commented Mar 9, 2016

Sorry for bothering you. I made vulkaninfo to work on HD 5500 with two small changes:
...

  • ./configure --with-dri-drivers=i965 --with-gallium-drivers= --with-sha1**=**
  • Copy libvulkan_intel.so from /lib to /usr/local/lib/
    ...
    And also I have to run every login sudo chmod 006 /dev/dri/renderD128.

Linux Mint 17.3
Linux kernel 3.19

@bkaradzic
Copy link

@rootext did you get "linux/memfd.h: No such file of directory" error?

@rootext
Copy link

rootext commented Apr 1, 2016

Sorry for delay response. I don't know if you still need it but the following patch helped me https://gist.github.com/cgmb/7f5ee12c00af5c655235#file-fix-missing-memfd-header-patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment