User avatar
rpiMike
Posts: 1530
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Script to build development Vulkan driver and demos

Sat Jun 13, 2020 4:23 pm

Here is a script to build the early development Vulkan driver and sample Vulkan demos.

https://github.com/mikehooper/PiScripts ... ll_v3dv.sh

The following should download and run the script (note does update and full-upgrade):

Code: Select all

cd ~
wget https://raw.githubusercontent.com/mikehooper/PiScripts/master/install_v3dv.sh
chmod +x install_v3dv.sh 
./install_v3dv.sh 
To run the demos (32bit):

Code: Select all

export VK_ICD_FILENAMES=/home/pi/local-install/share/vulkan/icd.d/broadcom_icd.armv7l.json
(64bit):

Code: Select all

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

Code: Select all

cd ~/Vulkan/build/bin/
./gears
Tested on Raspberry Pi OS 32bit and 64bit beta.

Please let me know if you get this working or I can make improvements.

Video: https://www.youtube.com/watch?v=ygBB3D5vryw
Blog: https://www.raspberrypi.org/blog/vulkan ... urce-code/
Driver: https://blogs.igalia.com/apinheiro/2020 ... ome-demos/

Image
Last edited by rpiMike on Sat Jul 04, 2020 11:52 am, edited 1 time in total.

fbe
Posts: 648
Joined: Thu Aug 17, 2017 9:08 pm

Re: Script to build development Vulkan driver and demos

Sat Jun 13, 2020 5:06 pm

Code: Select all

...
7/10 Build v3dv
./install_v3dv.sh: 35: ./install_v3dv.sh: meson: not found
pi@raspberrypi:~ $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
pi@raspberrypi:~ $
This is because /home/pi/.local/bin was created after login.

User avatar
rpiMike
Posts: 1530
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Script to build development Vulkan driver and demos

Sat Jun 13, 2020 5:19 pm

fbe wrote:
Sat Jun 13, 2020 5:06 pm

Code: Select all

...
7/10 Build v3dv
./install_v3dv.sh: 35: ./install_v3dv.sh: meson: not found
pi@raspberrypi:~ $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
pi@raspberrypi:~ $
This is because /home/pi/.local/bin was created after login.
Any suggestion to fix this?

BRX7
Posts: 91
Joined: Sat Aug 31, 2019 11:07 pm

Re: Script to build development Vulkan driver and demos

Sat Jun 13, 2020 5:31 pm

Hello,
I tried your script, its seems to have run properly, but I still get this message

Fatal : VkResult is "ERROR_INITIALIZATION_FAILED" in /home/pi/Vulkan/base/vulkanexamplebase.cpp at line 826
gears: /home/pi/Vulkan/base/vulkanexamplebase.cpp:826: bool VulkanExampleBase::initVulkan(): Assertion `res == VK_SUCCESS' failed.
Aborted


is there a log i can refer to?

User avatar
rpiMike
Posts: 1530
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Script to build development Vulkan driver and demos

Sat Jun 13, 2020 5:33 pm

BRX7 wrote:
Sat Jun 13, 2020 5:31 pm
Hello,
I tried your script, its seems to have run properly, but I still get this message

Fatal : VkResult is "ERROR_INITIALIZATION_FAILED" in /home/pi/Vulkan/base/vulkanexamplebase.cpp at line 826
gears: /home/pi/Vulkan/base/vulkanexamplebase.cpp:826: bool VulkanExampleBase::initVulkan(): Assertion `res == VK_SUCCESS' failed.
Aborted


is there a log i can refer to?
Which OS? Which Pi? Connected to hdmi screen?

BRX7
Posts: 91
Joined: Sat Aug 31, 2019 11:07 pm

Re: Script to build development Vulkan driver and demos

Sat Jun 13, 2020 5:35 pm

rpiMike wrote:
Sat Jun 13, 2020 5:33 pm
BRX7 wrote:
Sat Jun 13, 2020 5:31 pm
Hello,
I tried your script, its seems to have run properly, but I still get this message

Fatal : VkResult is "ERROR_INITIALIZATION_FAILED" in /home/pi/Vulkan/base/vulkanexamplebase.cpp at line 826
gears: /home/pi/Vulkan/base/vulkanexamplebase.cpp:826: bool VulkanExampleBase::initVulkan(): Assertion `res == VK_SUCCESS' failed.
Aborted


is there a log i can refer to?
Which OS? Which Pi?
Raspberrypi OS 32BIT, RPI4 8GB, updated , the kernel is still 32bit though i didnt switch to 64bit via rpi-update

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

then ./gears

fbe
Posts: 648
Joined: Thu Aug 17, 2017 9:08 pm

Re: Script to build development Vulkan driver and demos

Sat Jun 13, 2020 5:39 pm

Code: Select all

echo $PATH | grep $HOME/.local/bin || export PATH=$HOME/.local/bin:$PATH
...
should fix the path.

User avatar
rpiMike
Posts: 1530
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Script to build development Vulkan driver and demos

Sat Jun 13, 2020 5:43 pm

fbe wrote:
Sat Jun 13, 2020 5:39 pm

Code: Select all

echo $PATH | grep $HOME/.local/bin || export PATH=$HOME/.local/bin:$PATH
...
should fix the path.
I don't think export will work in a script?

User avatar
rpiMike
Posts: 1530
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Script to build development Vulkan driver and demos

Sat Jun 13, 2020 5:47 pm

BRX7 wrote:
Sat Jun 13, 2020 5:35 pm
rpiMike wrote:
Sat Jun 13, 2020 5:33 pm
BRX7 wrote:
Sat Jun 13, 2020 5:31 pm
Hello,
I tried your script, its seems to have run properly, but I still get this message

Fatal : VkResult is "ERROR_INITIALIZATION_FAILED" in /home/pi/Vulkan/base/vulkanexamplebase.cpp at line 826
gears: /home/pi/Vulkan/base/vulkanexamplebase.cpp:826: bool VulkanExampleBase::initVulkan(): Assertion `res == VK_SUCCESS' failed.
Aborted


is there a log i can refer to?
Which OS? Which Pi?
Raspberrypi OS 32BIT, RPI4 8GB, updated , the kernel is still 32bit though i didnt switch to 64bit via rpi-update

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

then ./gears
Maybe log an issue here: https://gitlab.freedesktop.org/apinheiro/mesa/-/issues

fbe
Posts: 648
Joined: Thu Aug 17, 2017 9:08 pm

Re: Script to build development Vulkan driver and demos

Sat Jun 13, 2020 6:10 pm

rpiMike wrote:
Sat Jun 13, 2020 5:43 pm
fbe wrote:
Sat Jun 13, 2020 5:39 pm

Code: Select all

echo $PATH | grep $HOME/.local/bin || export PATH=$HOME/.local/bin:$PATH
...
should fix the path.
I don't think export will work in a script?
It works, but it's scope ends when the script ends (if you don't source the script).

fbe
Posts: 648
Joined: Thu Aug 17, 2017 9:08 pm

Re: Script to build development Vulkan driver and demos

Sat Jun 13, 2020 6:58 pm

Build worked, "gears" work.
Raspberry Pi 4B 4GB
Raspberry Pi OS (32-bit) with desktop (2020-05-27)
Most settings default in /boot/config.txt (except for gpu_mem)

BRX7
Posts: 91
Joined: Sat Aug 31, 2019 11:07 pm

Re: Script to build development Vulkan driver and demos

Sat Jun 13, 2020 8:33 pm

ok confirming it works on a 32bit raspberry os image on a rpi4 4gb 1.2, usb boot .
not on a rpi4 8gb (sd boot)

User avatar
rpiMike
Posts: 1530
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Script to build development Vulkan driver and demos

Sat Jun 13, 2020 8:36 pm

fbe wrote:
Sat Jun 13, 2020 6:58 pm
Build worked, "gears" work.
Raspberry Pi 4B 4GB
Raspberry Pi OS (32-bit) with desktop (2020-05-27)
Most settings default in /boot/config.txt (except for gpu_mem)
Thanks, just added your path fix.

User avatar
rpiMike
Posts: 1530
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Script to build development Vulkan driver and demos

Sat Jun 13, 2020 8:37 pm

BRX7 wrote:
Sat Jun 13, 2020 8:33 pm
ok confirming it works on a 32bit raspberry os image on a rpi4 4gb 1.2, usb boot .
not on a rpi4 8gb (sd boot)
Thanks, looks like you logged the issue, nice.

BRX7
Posts: 91
Joined: Sat Aug 31, 2019 11:07 pm

Re: Script to build development Vulkan driver and demos

Sat Jun 13, 2020 10:05 pm

fixed it,
its the native resolution issue, i am using a 4k tv and os resolution was full hd, ive switched to 4k and just like minecraft-pi its works native res

User avatar
Gavinmc42
Posts: 4832
Joined: Wed Aug 28, 2013 3:31 am

Re: Script to build development Vulkan driver and demos

Sun Jun 14, 2020 3:38 am

It is working on a new 32bit Raspbian with the 5.4.44 update/upgrade :D
I had to update the OS on a Pi3B+ as my Pi4 already had the new bootloader, which does not like the 4.19 boot files.

Might have to play in 32bit land until the 64bit driver/script is sorted.

Thanks Mike.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
MattPurland
Posts: 62
Joined: Fri Apr 13, 2012 7:37 pm

Re: Script to build development Vulkan driver and demos

Wed Jul 01, 2020 3:08 pm

Just tried this out, has a small issue with the version of meson not being correct (had to manually update it) but all working well.

I'm getting 113fps on the sphericalenvmapping example, and 575fps on gears. Looks great!

I'm overclocked to 2ghz CPU and 700mhz GPU

User avatar
rpiMike
Posts: 1530
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Script to build development Vulkan driver and demos

Wed Jul 01, 2020 3:13 pm

Thanks for the feedback, updated script to force meson reinstall.


User avatar
rpiMike
Posts: 1530
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Script to build development Vulkan driver and demos

Sat Jul 04, 2020 7:12 am

Thanks for the link to the update.

User avatar
rpiMike
Posts: 1530
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Script to build development Vulkan driver and demos

Sat Jul 04, 2020 11:47 am

Development Vulkan driver now works on RPiOS64 beta.

Image

User avatar
Gavinmc42
Posts: 4832
Joined: Wed Aug 28, 2013 3:31 am

Re: Script to build development Vulkan driver and demos

Sun Jul 05, 2020 12:32 am

pi@raspberrypi:~/sascha-willems/build/bin $ ./gears
Could not create Vulkan instance :
ERROR_INITIALIZATION_FAILED
Same issue. Path? Must have missed a step
Everything compiles fine.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
rpiMike
Posts: 1530
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Script to build development Vulkan driver and demos

Sun Jul 05, 2020 6:35 am

Gavinmc42 wrote:
Sun Jul 05, 2020 12:32 am
pi@raspberrypi:~/sascha-willems/build/bin $ ./gears
Could not create Vulkan instance :
ERROR_INITIALIZATION_FAILED
Same issue. Path? Must have missed a step
Everything compiles fine.
Which OS? Did you delete the mesa folder to make sure you get the latest v3dv?

User avatar
Gavinmc42
Posts: 4832
Joined: Wed Aug 28, 2013 3:31 am

Re: Script to build development Vulkan driver and demos

Sun Jul 05, 2020 7:17 am

Linux raspberrypi 5.4.47-v8+ #1322 SMP PREEMPT Wed Jun 17 18:05:46 BST 2020 aarch64 GNU/Linux
Did not delete mesa, just renamed them and then git the new one.

I end up with a "broadcom_icd.aarch64.json" file and change the path to that name.
Could have missed another needed change for 64bit?

EDIT- copied broadcom_icd.aarch64.json into /etc/vulkan/icd.d
Now working, gears fps seems slower than OpenGL. 140 v 800.

Time for some fun :D
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 4832
Joined: Wed Aug 28, 2013 3:31 am

Re: Script to build development Vulkan driver and demos

Mon Jul 27, 2020 9:56 am

A repost- just in case I lose it.
Have not been on my Pi's for a few days, just noticed this.
vkquake is working.
http://planet.igalia.com/
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Graphics programming”