4

How can I build the Vulkan driver for linux mint?

I'm running Linux Mint Rafaella, 17.2, with Intel Graphics 5th gen, i3-5010U. I tried to compile https://cgit.freedesktop.org/mesa/mesa/tree/?h=vulkan, but it failed with:

anv_allocator.c:32:25: fatal error: linux/memfd.h: No such file or directory
    #include <linux/memfd.h>

I tried toying with installing different versions of linux-headers, but even if I managed to get rid of this error, others appeared.

Which version of linux-headers should I use and how to configure them in order to work? Or, what else should I do first, to make Vulkan compilable on my OS?

edit:

I decided to give a bit of insight into my process of compiling. I enhanced $VULKAN/src/vulkan/Makefile with

CFLAGS += -I"/usr/src/linux-headers-3.19.0-49/include/uapi"

and for CXXFLAGS I did same. New error appeared stating that linux/compiler.h is missing. Another enhancement to Makefile looked like this:

CFLAGS += -I"/usr/src/linux-headers-3.19.0-49/include/uapi" -I"/usr/src/linux-headers-3.19.0-49/include"

and for CXXFLAGS I did same. The next error is one I cannot get rid at all, mainly because of lack of knowledge:

anv_allocator.c:137:19: error: 'SYS_memfd_create' undeclared (first use in this function) return syscall(SYS_memfd_create, name, flags);

This is the error that made me question which version of linux-headers should I use. Also, it seems not right for me that memfd.h is located under uapi.

3

1 Answer 1

1

This looks like a job for apt-file!

apt-file search linux/memfd.h

This will output a list of packages, here's where some experience works its way in, selecting the right package. Usually foo-dev will be good, and the output from this command makes it look like linux-libc-dev is the package you'll need.

2
  • I have no output for apt-file search linux.memfd.h, only for apt-file search linux/memfd.h, but I can guarantee you I have linux-libc-dev installed. It was one of first possible solutions I found when I started searching. linux/memfd.h is found in all linux-header-NUMBER packages. I've tried some, like linux-headers-3.19.0-49 with no result. That's why I wrote in my question, that I need more of a guideline, what should I do. Of course copying /usr/src/linux-headers-.../linux/memfd.h into /usr/include won't do, but adding -I... to CFLAGS didn't do either, since new errors appeared.
    – dotPoozer
    Commented Feb 17, 2016 at 11:21
  • dpkg -L linux-libc-dev | grep memfd.h gives me no output aswell, but that was expectable. It may be that Mint has some older libc version.
    – dotPoozer
    Commented Feb 17, 2016 at 11:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .