RE: Native_SDK and Native-Compilation on the BBAI

Hello,

I am currently having an issue w/ the native-compilation on the BBAI w/ the SGX544.

I have put the cmake version needed on the BBAI to compile natively on the board, i.e. as my Debian, Linux Machine is down with issues with libcurl not accepting https right now.

[ 32%] VulkanIntroducingPVRShell: Compiling VertShader.vsh to VertShader.vsh.spv
glslangValidator -V --target-env vulkan1.0 /home/debian/Native_SDK-R21.1-v5.7/examples/Vulkan/02_IntroducingPVRShell/VertShader.vsh -o /home/debian/Native_SDK-R21.1-v5.7/build/examples/Vulkan/02_IntroducingPVRShell/VertShader.vsh.spv -S vert
/bin/sh: 1: ../../../../external/glslang/../glslangValidator/bin/linux/glslangValidator: Permission denied
make[2]: *** [examples/Vulkan/02_IntroducingPVRShell/CMakeFiles/VulkanIntroducingPVRShell.dir/build.make:82: examples/Vulkan/02_IntroducingPVRShell/VertShader.vsh.spv] Error 126
make[1]: *** [CMakeFiles/Makefile2:3474: examples/Vulkan/02_IntroducingPVRShell/CMakeFiles/VulkanIntroducingPVRShell.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Anyway…that is my issue I cannot get around. I have used cmake … and currently am trying to use cmake --build . to install the files in their respective place on the board.

Seth

P.S. If you have time, please try to reply so I can move forward. It seems I have a permission error on the BBAI. I have tried to add permissions and it fails w/ exec format.

Hi silver2row

This might be due to the glslangValidator binary not having executable permissions. Could you please try doing the following from the sdk root directory:

  1. Get the current permissions of the glslangValidator binary by running the following command and paste the output in your reply
ls -l ./external/glslangValidator/bin/linux/glslangValidator
# will output something like this:
# -rw-r--r-- 1 owner group 7391360 Aug 27 20:20 external/glslangValidator/bin/linux/glslangValidator
  1. Try adding executable permissions to the file with the following command and attempt building again with cmake --build .
chmod +x ./external/glslangValidator/bin/linux/glslangValidator

Hello,

I tried that already and it came up w/ an exec format error. Here is the ls -la command of glslangValidator.

-rw-r--r-- 1 debian debian 7391360 May 12 09:22 glslangValidator

and…here is the new error. Anyway, if you understand my issue again, please do contact me about it.

glslangValidator -V --target-env vulkan1.0 /home/debian/Native_SDK-R21.1-v5.7/examples/Vulkan/02_IntroducingPVRShell/VertShader.vsh -o /home/debian/Native_SDK-R21.1-v5.7/build/examples/Vulkan/02_IntroducingPVRShell/VertShader.vsh.spv -S vert /bin/sh: 1: ../../../../external/glslang/../glslangValidator/bin/linux/glslangValidator: Exec format error make[2]: *** [examples/Vulkan/02_IntroducingPVRShell/CMakeFiles/VulkanIntroducingPVRShell.dir/build.make:82: examples/Vulkan/02_IntroducingPVRShell/VertShader.vsh.spv] Error 2 make[1]: *** [CMakeFiles/Makefile2:3474: examples/Vulkan/02_IntroducingPVRShell/CMakeFiles/VulkanIntroducingPVRShell.dir/all] Error 2 make: *** [Makefile:136: all] Error 2

Seth

P.S. I will keep trying. I tried on WSL2 to compile things but Debian needs to be updated in many areas for this effort to take place on a cross-compile.

Hi Seth,

Sorry for missing that in your first message.

It looks like the way glslangValidator is used in the sdk was changed last release, cmake to pull the source from github and build it but was this was changed to pre-compiled binaries due to the lack of a github release tag supporting ray tracing extensions at the time. However the binaries in the SDK appear to only be for x86_64 which would explain why you can’t use it on your ARMv7-A BeagleBone.

We’ll work on getting this fixed so that other architectures are supported again but for now I recommend you build the glslangValidator binary on your BBAI to replace ./external/glslangValidator/bin/linux/glslangValidator. The latest source release can be found at https://github.com/KhronosGroup/glslang/releases/tag/11.6.0 and the readme contains building instructions.

  1. On the beaglebone, download and extract the latest glslang source release from
wget https://github.com/KhronosGroup/glslang/archive/refs/tags/11.6.0.tar.gz
tar -xzf 11.6.0.tar.gz
cd glslang-11.6.0
  1. Make a build directory and configure with cmake
mkdir build-dir
cd build-dir
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$(pwd)/install" ..
  1. Build the binary with make
make -j2 glslangValidator
  1. Replace the binary in {powervr_sdk}/external/glslangValidator/bin/linux/glslangValidator with the newly created ./StandAlone/glslangValidator

Let us know if it works.

Hello @David.Hamill ,

Seth here. I am using the command cmake --build . now. I will update you soon.

Seth

P.S. Firstly, on another version from github for the Native_SDK, I got trapped in /external/PVRScope/CMakeLists.txt source.

It seems there is an issue in that file that creates more issues w/ the newest build of the Native_SDK from the github repo. on the releases section w/ this file: https://github.com/powervr-graphics/Native_SDK/archive/refs/tags/R21.1-v5.7.tar.gz .

Anyway…it seemed that the listed files below are at fault w/ the errors I received. I added the Linux_arm7l dir. to the file system and added a libPVRScopeDeveloper.a file to it (probably a mistake b/c the file may not be compiled to handle armv7l arch.

cat: Linux_armv7: Is a directory
cat: Linux_armv7hf: Is a directory
cat: Linux_armv7l: Is a directory

I am building on the BBAI now, i.e. testing the BBAI and not the BBB. Anyway, I just wanted you to know in case you thought I was using the BBB.

Hello @David.Hamill ,

It builds until 22%. Then, it stops w/ this error message:

make[2]: *** No rule to make target '../external/PVRScope/../../lib/Linux_armv7l/libPVRScopeDeveloper.a', needed by 'bin/OpenGLESPVRScopeExample'.  Stop.
make[1]: *** [CMakeFiles/Makefile2:3181: examples/OpenGLES/PVRScopeExample/CMakeFiles/OpenGLESPVRScopeExample.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Seth

P.S. I got past this point earlier, the PVRScope issue, to create the first issue that we discussed earlier this morning. But…I thought this is what I should show now after listening to your commands from above.

Hi @silver2row

It looks like your issue has something to do with the sdk cmake configuration not accepting the library in your lib/Linux_armv7l folder. The Linux_armv7 libPVRScopeDeveloper.a should work fine on a Linux_armv7l device. I’m currently tracking down an armv7l device to test your issue on, I’ll get back to you as soon as I can.

Apologies for the wait,
David

Hello @David.Hamill ,

No issue. I will wait. Thank you for taking time out to figure this out.

Seth

Hi @silver2row

I got my hands on a beaglebone black which like your bbai has armv7l architecture, and after making a directory lib/Linux_armv7l and copying the scope library the sdk compiled fine. lib/Linux_armv7l/libPVRScopeDeveloper.a definitely exists on your end right? If so then try running make clean to clean the intermediate build files.

Side note: cmake --build . does the same thing as running make. To speed up your PVRScope debugging I recommend just building a single example rather than all of them by running make OpenGLESPVRScopeExample

Kind Regards,
David

Hello,

@David.Hamill , yes sir. The libPVRScopeDeveloper.a file is listed in that dir.

I will try this route and get back to you. I will try make for building just one lib. instead of the entire package.

Seth

Hi @silver2row

Did you have any success with this? Just to clarify you’ll have to run cmake . first to generate the Makefile to run make with.

To have a cleaner building environment I usually create a directory in the root of a project named build, cd into it, run cmake .. (the .. points to the CMakeLists.txt file) then run make inside that build folder so all the intermediate build files are nicely stored away from the project files.

Kind Regards,
David

Hello @David.Hamill ,

Seth here. I have not been able to handle this project for some time. Bogged down w/ duties…

I was trying this for fun for now to get acquainted w/ the AI and its processing power.

Seth

P.S. After jumping into the categories that are available w/ cmake . and using make to handle each, individual library, I will finally conquer the task. Until then, I am sort of floating right now from project to project.

Testing will ensue and soon!

Hello Again @David.Hamill ,

Seth here. I just found a new image from BBB.io on their forums and it is by rcn-ee. Anyway, the updated image for the BBAI has the Debian Bullseye Distro on it.

The main reason I was having difficulties was due to Python3.7.x when Python3.9.x was needed for some of the prerequisites.

Seth

P.S. I will update you soon. I flashed the new image and I am installing the SDK from github now.

© Imagination Technologies Limited. All rights reserved.
Privacy PolicyTerms & ConditionsTrademarksCookies