v3dv: quick guide to build and run some demos

Just today it has published a status update of the Vulkan effort for the Raspberry Pi 4, including that we are moving the development of the driver to an open repository. As it is really likely that some people would be interested on testing it, even if it is not complete at all, here you can find a quick guide to compile it, and get some demos running.

Dependencies

So let’s start installing some dependencies. My personal recipe, that I use every time I configure a new machine to work on mesa is the following one (sorry if some extra unneeded dependencies slipped):

sudo apt-get install libxcb-randr0-dev libxrandr-dev \
        libxcb-xinerama0-dev libxinerama-dev libxcursor-dev \
        libxcb-cursor-dev libxkbcommon-dev xutils-dev \
        xutils-dev libpthread-stubs0-dev libpciaccess-dev \
        libffi-dev x11proto-xext-dev libxcb1-dev libxcb-*dev \
        bison flex libssl-dev libgnutls28-dev x11proto-dri2-dev \
        x11proto-dri3-dev libx11-dev libxcb-glx0-dev \
        libx11-xcb-dev libxext-dev libxdamage-dev libxfixes-dev \
        libva-dev x11proto-randr-dev x11proto-present-dev \
        libclc-dev libelf-dev git build-essential mesa-utils \
        libvulkan-dev ninja-build libvulkan1 python-mako \
        libdrm-dev libxshmfence-dev libxxf86vm-dev \
        python3-mako

Most Raspian libraries are recent enough, but they have been updating some of then during the past months, so just in case, don’t forget to update:

$ sudo apt-get update
$ sudo apt-get upgrade

Additionally, you woud need to install meson. Mesa has just recently bumped up the version needed for meson, so Raspbian version is not enough. There is the option to build meson from the tarball (meson-0.52.0 here), but by far, the easier way to get a recent meson version is using pip3:

$ pip3 install meson

2020-07-04 update

It seems that some people had problems if they have installed meson with apt-get on their system, as when building it would try the older meson version first. For those people, they were able to fix that doing this:

$ sudo apt-get remove meson
$ pip3 install --user meson

Download and build v3dv

This is the simpler recipe to build v3dv:

$ git clone https://gitlab.freedesktop.org/apinheiro/mesa.git mesa
$ cd mesa
$ git checkout wip/igalia/v3dv
$ meson --prefix /home/pi/local-install --libdir lib -Dplatforms=x11,drm -Dvulkan-drivers=broadcom -Ddri-drivers= -Dgallium-drivers=v3d,kmsro,vc4 -Dbuildtype=debug _build
$ ninja -C _build
$ ninja -C _build install

This builds and install a debug version of v3dv on a local directory. You could set a release build, or any other directory. The recipe is also building the OpenGL driver, just in case anyone want to compare, but if you are only interested on the vulkan driver, that is not mandatory.

Run some Vulkan demos

Now, the easiest way to ensure that a vulkan program founds the drivers is setting the following envvar:

export VK_ICD_FILENAMES=/home/pi/local-install/share/vulkan/icd.d/broadcom_icd.armv7l.json

That envvar is used by the Vulkan loader (installed as one of the dependencies listed before) to know which library load. This also means that you don’t need to use LD_PRELOAD, LD_LIBRARY_PATH or similar

So what Vulkan programs are working? For example several of the Sascha Willem Vulkan demos. To make things easier to everybody, here another quick recipe of how to get them build:

$ sudo apt-get install libassimp-dev
$ git clone --recursive https://github.com/SaschaWillems/Vulkan.git  sascha-willems
$ cd sascha-willems
$ mkdir build; cd build
$ cmake -DCMAKE_BUILD_TYPE=Debug  ..
$ make

Update 2020-08-03: When the post was originally written, some demos didn’t need to ask for extra assets. Recently the fonts were moved there, so you would need to gather the assests always:

$ cd ..
$ python3 download_assets.py

So in order to see a really familiar demo:

$ cd build/bin
$ ./gears

And one slightly more complex:

$./scenerendering

As mentioned, not all the demos works. But a list of some that we tested and seem to work:
* distancefieldfonts
* descriptorsets
* dynamicuniformbuffer
* gears
* gltfscene
* imgui
* indirectdraw
* occlusionquery
* parallaxmapping
* pbrbasic
* pbribl
* pbrtexture
* pushconstants
* scenerendering
* shadowmapping
* shadowmappingcascade
* specializationconstants
* sphericalenvmapping
* stencilbuffer
* textoverlay
* texture
* texture3d
* texturecubemap
* triangle
* vulkanscene

Update : rpiMike on the comments, and some people privately, have pointed some errors on the post. Thanks! And sorry for the inconvenience.

Update 2 : Mike Hooper pointed more issues on gitlab

51 thoughts on “v3dv: quick guide to build and run some demos”

  1. Changed 1st clone to:
    git clone https://gitlab.freedesktop.org/apinheiro/mesa.git mesa

    Changed meson install to, so ‘meson’ worked:
    sudo pip3 install meson

    Now getting:
    meson –prefix /home/pi/local-install –libdir lib -Dplatforms=x11,drm -Dvulkan-drivers=broadcom -Ddri-drivers= -Dgallium-drivers=v3d,kmsro,vc4 -Dbuildtype=debug _build
    The Meson build system
    Version: 0.54.2
    Source dir: /home/pi/mesa
    Build dir: /home/pi/mesa/_build
    Build type: native build
    Program python found: YES (/usr/bin/python)

    meson.build:21:0: ERROR: Options “broadcom” are not in allowed choices: “, auto, amd, intel”

    A full log can be found at /home/pi/mesa/_build/meson-logs/meson-log.txt

    1. Yes, once you get the proper repository cloned, you need to move to the correct branch:
      $ git branch wip/igalia/v3dv

      I have just updated the post. Thanks for reporting, and sorry for the inconvenience.

  2. was interested in trying this on archlinux in my case I tried on manjaro 64bit and I got an error while compiling.

    https://www.pastiebin.com/5ee3c5f20b6bd

    it was pretty far along (977 of 1155 or something)
    hopefully it just means I cloned the git at a bad time?

    hoping to test dolphin emu under vulkan vs gles and compare πŸ™‚

    1. > hopefully it just means I cloned the git at a bad time?

      As I just explained to other developer testing 64bit, for now we are focusing on 32-bit. We would revisit that as the driver gets more mature.

      Having said so, note that the build is failing on gallium utilities that the vulkan driver is using, and not exactly on the main source code of the driver. So I suspect that perhaps you would need some extra options when calling meson.

      > hoping to test dolphin emu under vulkan vs gles and compare

      We have advanced a lot on the past months, but the driver is still on the early stages. In fact I have just skimmed the dolphin code here:

      https://github.com/dolphin-emu/dolphin.git dolphin-emu

      and it uses Vulkan features like compute shaders and texel buffers that v3dv still doesn’t support. So sorry, but such comparison is still not possible.

  3. Hello, thanks for your work!
    Following your instructions, I was able to successfully run everything on OS 32bit.
    In OS 64bit Beta almost everything worked (only one file in share/vulkan/icd.d that generated as aarch64.json instead of armv7l.json), but when trying to run the demos it raises an error VkResult is “ERROR_INITIALIZATION_FAILED” (res == VK_SUCCESS failed) .

    1. Hi, thanks for testing on both 32 and 64 bit. Unfourtunately, the failure on 64 bit is expected. Right now we are focused on getting the vulkan driver working on the 32-bit Raspbian first. We didn’t even start to test on the 64bit Beta. When we got a conformant, or almost 1.0 conformant driver working on 32-bit, we would need to evaluate the priorities about the next thing to work on (there are plenty of options, 64-bit support, work on performance, 1.1, etc)

        1. Update, as instructed in the thread from a later comment below, I reset the environment variable which was set by the command,

          export VK_ICD_FILENAMES=/home/pi/local-install/share/vulkan/icd.d/broadcom_icd.armv7l.json

          in the tutorial with the following command:

          export VK_ICD_FILENAMES=/home/pi/local-install/share/vulkan/icd.d/broadcom_icd.aarch64.json

          That’s all it took and now the Willems Vulkan demos are running on my Ubuntu Mate 64-bit Raspberry Pi4! GREAT tutorial and a huge boon in reducing the time I need to run my big, noisy tower machine. πŸ˜‰

  4. Git branch doesn’t switch to a branch unless creating a new one. If anybody have problems with switching to a proper branch try typing:
    git switch wip/igalia/v3dv

    1. I just noticed that git that is on my system is a lot more recent that the one available in buster Raspberry Pi OS repository. I discovered that when I tried to build the driver under a fresh install of 32-bit Raspberry Pi OS Lite. “git switch” is available since git 2.23, and the one in the repo at the time of writing is 2.20.1. So if you want to switch to a branch you should type:
      git checkout wip/igalia/v3dv
      When typing “git branch wip/igalia/v3dv” you will create a new local branch and not change the branch to the branch that resides on remote origin, which is what you want.
      Sorry if I confused anybody with my initial comment as this worked because I was at testing suite of RPi repo

  5. Also you may also need to run this as they are dependencies that may not be on your system:
    pip3 install meso
    apt install libxshmfence-dev

  6. Dear Raspberry Pi Team,
    This is wonderful! Please keep up the good work.

    A few comments:

    1) I also had to use
    git clone –single-branch –branch wip/igalia/v3dv https://gitlab.freedesktop.org/apinheiro/mesa.git
    as gaara suggested above. The method in post did not work.

    2) I had to install a few other development packages:
    python3-mako, libdrm-dev, libxshmfence-dev, libxxf86vm-dev, libassimp-dev, and cmake, of course.
    There were a few others, but I cannot remember if they were for something I am writing or just for purposes of this guide.

    Otherwise, beautiful – indeed many Willems tests run.

      1. Note that the people that suggested that option is writing that with double ‘-‘, so:

        $git clone –-single-branch –-branch wip/igalia/v3dv https://gitlab.freedesktop.org/apinheiro/mesa.git

        Having said so, since people pointed me out that my initial recipe has some errors (sorry and thanks!), I have updated the recipe, so C&P from the current state of the post:

        $ git clone https://gitlab.freedesktop.org/apinheiro/mesa.git mesa
        $ cd mesa
        $ git checkout wip/igalia/v3dv

        1. Still not working. πŸ™

          pi@raspberrypi:~/mesa $ meson –prefix /home/pi/local-install –libdir lib -Dplatforms=x11,drm -Dvulkan-drivers=broadcom -Ddri-drivers= -Dgallium-drivers=v3d,kmsro,vc4 -Dbuildtype=debug _build
          The Meson build system
          Version: 0.54.3
          Source dir: /home/pi/mesa
          Build dir: /home/pi/mesa/_build
          Build type: native build
          Program python found: YES (/usr/bin/python)
          Project name: mesa
          Project version: 20.2.0-devel
          C compiler for the host machine: cc (gcc 8.3.0 “cc (Raspbian 8.3.0-6+rpi1) 8.3.0”)
          C linker for the host machine: cc ld.bfd 2.31.1
          C++ compiler for the host machine: c++ (gcc 8.3.0 “c++ (Raspbian 8.3.0-6+rpi1) 8.3.0”)
          C++ linker for the host machine: c++ ld.bfd 2.31.1
          Host machine cpu family: arm
          Host machine cpu: armv7l
          Program python3 found: YES (/usr/bin/python3)

          meson.build:877:2: ERROR: Problem encountered: Python (3.x) mako module >= 0.8.0 required to build mesa.

          A full log can be found at /home/pi/mesa/_build/meson-logs/meson-log.txt

          1. Try to install python3-mako :
            $ sudo apt-get install python3-mako

            Some people before pointed that package is also needed. I have just updated the recipe.

        2. After $ sudo apt-get install python3-mako things worked fine, but when I closed the terminal and tried to run demos later, this error appeared:

          Could not create Vulkan instance :
          ERROR_EXTENSION_NOT_PRESENT

          1. When you opened a new terminal to run the demos, did you remember to export the envvar with the location of the ICD?:

            export VK_ICD_FILENAMES=/home/pi/local-install/share/vulkan/icd.d/broadcom_icd.armv7l.json

  7. Thanks Raspberry Pi Team for this amazing work!

    I sucessfully installed the Vulkan drivers and run most examples. I’m wondering if readless operation will be supported in the future? The `renderheadless` example did not work without a X11 server.

    1. Thanks for the feedback. That is a interesting comment, as I assumed that the renderheadless demo just worked. Didn’t realize that it needed a X11 server. Having said so, we are still missing several 1.0 core features. Our main focus right now is getting Vulkan 1.0 core supported (so getting vk-gl-cts for 1.0 passing). I hope that to be enough to get that test working without X11 server.

  8. I have this issue πŸ™

    meson –prefix /home/pi/local-install –libdir lib -Dplatforms=x11,drm -Dvulkan-drivers=broadcom -Ddri-drivers= -Dgallium-drivers=v3d,kmsro,vc4 -Dbuildtype=debug _build
    The Meson build system
    Version: 0.49.2
    Source dir: /home/pi/src/mesa
    Build dir: /home/pi/src/mesa/_build
    Build type: native build
    Program python found: YES (/usr/bin/python)

    meson.build:21:0: ERROR: Meson version is 0.49.2 but project requires >= 0.52.

    Machine infos: Raspberrypi 4 4GB Ram

    uname -a
    Linux raspberrypi 5.4.47-v7l+ #1322 SMP Wed Jun 17 17:58:52 BST 2020 armv7l GNU/Linux

    cat /etc/os-release
    PRETTY_NAME=”Raspbian GNU/Linux 10 (buster)”
    NAME=”Raspbian GNU/Linux”
    VERSION_ID=”10″
    VERSION=”10 (buster)”
    VERSION_CODENAME=buster
    ID=raspbian
    ID_LIKE=debian
    HOME_URL=”http://www.raspbian.org/”
    SUPPORT_URL=”http://www.raspbian.org/RaspbianForums”
    BUG_REPORT_URL=”http://www.raspbian.org/RaspbianBugs”

    1. “meson.build:21:0: ERROR: Meson version is 0.49.2 but project requires >= 0.52.”

      Please re-read the guide. It clearly points that Mesa recently bumped meson requirement, and that you need to install a newer version of meson.

      1. you true i forgot to mention

        sudo pip3 install meson
        Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
        Requirement already satisfied: meson in /usr/lib/python3/dist-packages (0.49.2)

        i download the meson last sources and

        python3 -m pip install meson
        Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
        Requirement already satisfied: meson in /home/pi/meson-0.52.0 (0.52.0)

        after :
        meson –prefix /home/pi/local-install –libdir lib -Dplatforms=x11,drm -Dvulkan-drivers=broadcom -Ddri-drivers= -Dgallium-drivers=v3d,kmsro,vc4 -Dbuildtype=debug _build
        The Meson build system
        Version: 0.49.2
        Source dir: /home/pi/src/mesa
        Build dir: /home/pi/src/mesa/_build
        Build type: native build
        Program python found: YES (/usr/bin/python)

        meson.build:21:0: ERROR: Meson version is 0.49.2 but project requires >= 0.52.

        A full log can be found at /home/pi/src/mesa/_build/meson-logs/meson-log.txt

        dho!!

        1. FIXED!
          please add this in your guide for other ppl πŸ™‚

          first is need to
          sudo apt remove meson

          after is need to

          pip3 install –user meson
          Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
          Collecting meson
          Downloading https://www.piwheels.org/simple/meson/meson-0.54.3-py3-none-any.whl (643kB)
          100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 645kB 658kB/s
          Installing collected packages: meson
          Successfully installed meson-0.54.3

          tadaaaaa

          meson –version
          0.54.3

          1. > please add this in your guide for other ppl

            Just added a note. Thanks for the feedback.

  9. Can you add vkmark to future posts ( it works with default settings but produces artifacts running vkmark -s 1920×1080)

    1. Thanks. Interesting, I didn’t know about that project. Looking a little seems a project inspired on glmark2. And one good thing is that it has a list of scenes, so we could triage/measure performance using different scenes.

      Out of curiosity, those artifacts happens with all the scenes, or with just some in particular?

      1. It happens with most, i think it’s a tile like pattern, but it could also be vertical lines. It looks like it appears with the scenes with models

    1. Only if your computer has 8 cores, that btw, rpi4 doesn’t have. In fact, taking into account that the rpi4 has 4 cores, it is really likely that “make -j8” is worse that “make -j4”.

      In any case, note that this is a quick guide. The idea is providing the quicker and simpler guide to get those build and running.

  10. I did test this on 64bit raspberry os with sid repos and on gears I got the following output:

    pi@raspberrypi:~/sascha-willems/build/bin $ ./gears
    vk: error: v3dv_GetPhysicalDeviceProperties2: ignored VkStructureType 1000212000:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT

    WARNING: v3dv is neither a complete nor a conformant Vulkan implementation. Testing use only.
    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000127001:VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000072002:VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000127001:VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000072002:VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000127001:VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000072002:VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000127001:VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000072002:VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000127001:VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000072002:VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO

    gears: /home/pi/sascha-willems/external/imgui/imgui_draw.cpp:1573: ImFont* ImFontAtlas::AddFontFromFileTTF(const char*, float, const ImFontConfig*, const ImWchar*): Assertion `0′ failed.
    Aborted

    I know 64bit is not your priority, but maybe it helps to improve the driver. πŸ™‚

    1. Hi,

      That error is not coming from the driver. I have just checked, and it seems that recently fonts have moved to assets, so you need to gather them always, not just for some demos. I have just updated the blog post to mention that.

      Thanks for the feedback.

      1. Thanks for your quick help. Now I can confirm your driver does work on 64bit. Its running the gears demo atleast. I will do more testing now. πŸ™‚

  11. Installed and everything works. Demo’s run well. Tried to build my game engine that uses Vulkan and it’s looking for libOpenVG.so. This file is no where to be found on Raspbian. Not sure if it’s a bit soon to be trying this with my game engine.

    1. Hi, thanks for testing it. But as far as I remember Mesa doesn’t implement OpenVG in general, and we don’t have short term plans to implement it neither.

      In any case Vulkan and OpenVG are two different standards. Vulkan doesn’t depend on OpenVG so unless your game engine is using both Vulkan and OpenVG that shouldn’t be a problem.

      1. My mistake. Had some old link statements in one of my CMakeLists.txt files that went back to the OpenGL version of the engine when these libraries were part of Raspbian.

        My Vulkan game engine runs on Raspbian! Awesome! I’ve been waiting for the day I could do my game development on my Raspberry Pi! Thank you so much!

  12. You don’t need to uninstall meson, just

    $ export PATH=$HOME/.local/bin:$PATH

    To give more priority to the meson installed through pip.

    Anyway, awesome work!

  13. Thought I’d show the information displayed from my game engine running Vulkan on Raspberry Pi.
    What’s interesting is the minimum swap chain image count is 3, max is 0 but vkGetSwapchainImagesKHR returns 5. Not sure why it needs so many swap chain images.

    Physical Device Extension(s)…
    VK_KHR_swapchain

    Instance Extension(s)…
    VK_KHR_surface
    VK_KHR_xlib_surface
    VK_EXT_debug_report
    VK_KHR_get_physical_device_properties2

    Application Info…
    Structure Type: 0
    App Name: Template Game
    App Version: 1
    Engine Name: Waffles Game Engine
    Engine Version: 1
    API Version: 4194304

    vk: error: v3dv_GetPhysicalDeviceProperties2: ignored VkStructureType 1000212000:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT

    WARNING: v3dv is neither a complete nor a conformant Vulkan implementation. Testing use only.
    Physical Device Properties (0)…
    GPU Name: V3D 4.2
    GPU Type: Integrated GPU
    GPU Driver Version: 83894371
    GPU Vender Id: 5348
    GPU Device Id: 0
    Max Image 1D: 4096
    Max Image 2D: 4096
    Max Image 3D: 4096
    Max Viewports: 1

    Queue Family Properties (0)…
    Queue Flags: b00000000000000000000000000000111
    Queue Count: 1
    Timestamp Valid Bits: 0x0000
    Min Image Transfer Granularity: 1 x 1 x 1
    Graphics Bit: true
    Compute Bit: true
    Transfer Bit: true
    Sparse Binding Bit: false
    Protected Bit: false

    SELECTED Physical Device Index: 0
    SELECTED Graphics Queue Family Index: 0
    UNAVAILABLE Transfer Queue Family Index: 4294967295
    UNAVAILABLE Presentation Queue Family Index: 4294967295

    Surface Capabilities…
    Min Image Count: 3
    Max Image Count: 0
    Current Extent: 636 x 1130
    Min Image Extent: 636 x 1130
    Max Image Extent: 636 x 1130
    Max Image Array Layers: 1
    Supported Transform Flags: b00000000000000000000000000000001
    Current Transform Flags: 0x00000000000000000000000000000001
    Supported Composite Alpha Flags: b00000000000000000000000000001001
    Supported Usage Flags: b00000000000000000000000000011011

    Surface Format(s)…

    Format: 50
    Color Space: 0

    SELECTED
    Format: 44
    Color Space: 0

    Swapchain Create Info…
    sType: 1000001000
    flags: b00000000000000000000000000000000
    Min Image Count: 3
    Image Extent: 636 x 1130
    Image Array Layers: 1
    Image Sharing Mode: 0x0000
    Pretransform: 0x0001
    Composite Alpha: 0x0001
    Present Mode: b00000000000000000000000000000001
    Clipped: true

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000127001:VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000072002:VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000127001:VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000072002:VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000127001:VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000072002:VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000127001:VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000072002:VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000127001:VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO

    vk: error: v3dv_AllocateMemory: ignored VkStructureType 1000072002:VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO

    Swap chain image count doesn’t match! (3 / 5)

    1. > What’s interesting is the minimum swap chain image count is 3, max is 0 but vkGetSwapchainImagesKHR returns 5. Not sure why it needs so many swap chain images.

      After a quick skim, 3 and 0 are just the min and maximum (0 for as many as memory allows), and 5 seems just the number returned by default. Having said so…

      > Swap chain image count doesn’t match! (3 / 5)

      … this seems a message from your engine. Does that mean that you specifically asked for the minimum, and you still got 5?

      1. > … this seems a message from your engine. Does that mean that you specifically asked for the minimum, and you still got 5?

        Yes. By default I set the VkSwapchainCreateInfoKHR minImageCount to the minimum but I get 5 back.
        m_swapchainInfo.minImageCount = surfCapabilities.minImageCount;

        Running my engine on my gaming PC (and other PCs) will return the same swap chain image count as the minimum. I see a similar behavior when running my engine on Android. It will have a minimum of 2 but return 3. It’s that difference that inspired me to add the check.

        1. Hi, this is interesting. In any case, I guess that this is allowed by spec, for some reason, because if not, I found really strange to not have detected by one of the vk-gl-cts tests. Unfourtunately Im somewhat busy to check that (we are on the process to try to upstream the driver) right now. To not forget, and make easier to ask other people working on the driver, I created this issue:

          https://gitlab.freedesktop.org/apinheiro/mesa/-/issues/9

          Thanks for the feedback.

          [1] https://lists.freedesktop.org/archives/mesa-dev/2020-September/224619.html

Leave a Reply

Your email address will not be published. Required fields are marked *