Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install on 64-bit #6

Open
Joseph-Azzam opened this issue Jun 17, 2020 · 13 comments
Open

How to install on 64-bit #6

Joseph-Azzam opened this issue Jun 17, 2020 · 13 comments

Comments

@Joseph-Azzam
Copy link

Joseph-Azzam commented Jun 17, 2020

Hi,
I'm a bit stuck and would appreciate your help.
I don't have experience installing drivers for Linux, not sure if I'm missing something.
I followed the steps in Build.MD:

How to compile on a Raspberry Pi
Clone RPi VK Driver
git clone https://github.com/Yours3lf/rpi-vk-driver.git
cd rpi-vk-driver
mkdir build
cd build

Run CMake
cmake .. -DCMAKE_BUILD_TYPE=Release

Build project
cmake --build . --target all

I executed them successfully, except for "_cmake --build . --target all" had a couple of error compiling armv6.
I get stuck on run Install.sh
install.sh is missing the "librpi-vk-driver.so"
not sure if it's important but either way the driver does not install.

I am using Raspberi Pi OS Beta to run a AArch64 Vulkan app.
Thank you in advance

@Yours3lf
Copy link
Owner

Yours3lf commented Jun 18, 2020

Hey,

the master branch is very much in development, it might not always build. I fixed it now, so please try again.
You need the cmake build step to finish successfully so you can install the driver SO file (librpi-vk-driver.so) to the right place.

cheers

@darkdragon-001
Copy link

For the release v1.0, use

git clone -b v1.0 https://github.com/Yours3lf/rpi-vk-driver.git

@Joseph-Azzam
Copy link
Author

I am working on a raspberry pi 3b+, with raspberry pi OS 64bit Arch64 beta.
I downloaded the latest master and release v1 versions, and still encountered compile errors.
I commented in makelist.txt the armv6 architecture line, and uncommented armv8a.
I also added set(CMAKE_CXX_FLAGS "=fpermissive").
Compile required .so libraries that are included in the project but where skipped because they are incompatible, so I manually downloaded the equivalent one using apt-get "missing-library-name-dev".
I included math.h in a certain library that complained about using log2.
That fixed most of the errors, but the main error I could not fix was, which came up in multiple files:
error: cannot convert ‘VkImageView’ {aka ‘VkImageView_T*’} to ‘VkImage’ {aka ‘VkImage_T*’} in assignment
imageMemoryBarrier.image = depthImageView;

Am I missing something?

@Yours3lf
Copy link
Owner

It compiles fine on the latest release of raspberry pi os, have you tried that?

@Joseph-Azzam
Copy link
Author

I need it to work on the 64-bit raspberry OS to make use of the AArch64 support.

@Yours3lf Yours3lf reopened this Jun 24, 2020
@Yours3lf
Copy link
Owner

Yours3lf commented Jun 24, 2020

Reopening for testing on 64bit Raspberry Pi OS. Since it's still beta I can't guarantee it's going to work.
Just use the 32 bit version for now.

@Yours3lf
Copy link
Owner

so to build on arm64

  1. set arch to armv8-a in CMakeLists.txt
  2. add compile option -fpermissive in CMakeLists.txt
  3. install libdrm-dev, libx11-dev, libxrandr-dev, libmtdev-dev, libevdev-dev, libudev-dev, libinput-dev
  4. build and install https://github.com/KhronosGroup/Vulkan-Headers
  5. set VULKAN_HEADERS_INSTALL_DIR=/usr/local
  6. build and install Vulkan-Loader with -DBUILD_WSI_WAYLAND_SUPPORT=OFF
  7. change depthImageView to depthImage when it complains (or just don't build that test)

@Yours3lf
Copy link
Owner

Then if you test blending for example you get:
Thread 1 "blending" received signal SIGSEGV, Segmentation fault.
0x0000007ff7a6b3d8 in rpi_vkCreateShaderModule (device=0x55555a2b50, pCreateInfo=0x7fffffdf58, pAllocator=0x0, pShaderModule=0x55555a2cb0) at /home/pi/rpi-vk-driver/driver/shader.c:34
34 assert(ci->instructions);
(gdb) bt
#0 0x0000007ff7a6b3d8 in rpi_vkCreateShaderModule (device=0x55555a2b50, pCreateInfo=0x7fffffdf58, pAllocator=0x0, pShaderModule=0x55555a2cb0) at /home/pi/rpi-vk-driver/driver/shader.c:34
#1 0x0000007ff7a53658 in createBufferToTextureShaderModule (device=0x55555a2b50, blitShaderModule=0x55555a2cb0) at /home/pi/rpi-vk-driver/driver/copy.c:647
#2 0x0000007ff7a53a68 in setupEmulationResources (device=0x55555a2b50) at /home/pi/rpi-vk-driver/driver/copy.c:962
#3 0x0000007ff7a57ca8 in rpi_vkCreateDevice (physicalDevice=0x55555a2898, pCreateInfo=0x7ffffff090, pAllocator=0x0, pDevice=0x5555665538) at /home/pi/rpi-vk-driver/driver/device.c:364
#4 0x0000007ff7f6a6f4 in ?? () from /usr/lib/aarch64-linux-gnu/libvulkan.so.1
#5 0x0000007ff7f72090 in ?? () from /usr/lib/aarch64-linux-gnu/libvulkan.so.1
#6 0x0000007ff7f75244 in vkCreateDevice () from /usr/lib/aarch64-linux-gnu/libvulkan.so.1
#7 0x0000005555565cc4 in createLogicalDevice () at /home/pi/rpi-vk-driver/test/blending/blending.cpp:411
#8 0x0000005555564d80 in setupVulkan () at /home/pi/rpi-vk-driver/test/blending/blending.cpp:140
#9 0x0000005555568104 in main () at /home/pi/rpi-vk-driver/test/blending/blending.cpp:1360

which probably happens because I never tested the driver on 64bit, so you'll run into issues with that (pointers being 8 bytes long etc.)

@Yours3lf Yours3lf pinned this issue Jun 24, 2020
@Yours3lf Yours3lf unpinned this issue Jun 24, 2020
@Joseph-Azzam
Copy link
Author

Thank you, I will try those changes over the weekend

@paulwratt
Copy link

can someone change the topic title to say "How to build for 64bit?" (easier to find later)

thanx for this info and the whole project @Yours3lf - OpenArena just does not cut it

@Joseph-Azzam Joseph-Azzam changed the title How to install How to install on 64-bit Jun 26, 2020
@Joseph-Azzam
Copy link
Author

Hi Yours3lf, Thank you a ton for taking the time to look into this, it's appreciated.
I can confirm the installation worked by following these steps.

@paulwratt
Copy link

Unless these 64bit build instructions are posted in a doc within the project, can I ask this issue stays open as an "instructional" issue, which should come up in searches

@vanfanel
Copy link

@Yours3lf:
In the first place, congratulations for this massive archivement: Vulkan on Pi3 is something I couldn't even imagine!! :-O

I am also trying to build for Raspbian OS 64bit, instead of Raspbian OS.
I found the instructions in this thread by pure chance, so I think @paulwratt is right: This thread should be re-opened or the 64bit building instructions should be added to README.md or BUILD.md

@Joseph-Azzam Joseph-Azzam reopened this Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants