Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: obutk on April 30, 2022, 05:00:51 PM
-
Is it possible to use the Videocore IV hardware when developing programs in tinycore? I have to perform image processing on the RPi, and I thought maybe I could get some speed boost by targeting the GPU.
I have tried using two C/C++ libraries for creating programs to run on the VideoCore GPU. While I was able to compile them, they always fail at runtime (segfault or a generic error).
For reference, these are the libraries I've tried:
https://github.com/wimrijnders/V3DLib
https://github.com/doe300/VC4CL
Is there any kind of configuration (bootcode or config.txt) or package that I should be using to make this possible?
-
I played around with gpu hardware acceleration using piCore64 on an RPi4 - I believe this is VideoCore VI.
glxinfo | grep -i gpu
GL_EXT_gpu_program_parameters, GL_EXT_gpu_shader4,
..and this plays a video using hardware acceleration: ffplay -i test_video.mp4 -vcodec h264_v4l2m2m
If you let me know how you tested https://github.com/wimrijnders/V3DLib I can give it a try although it might not be relevent to VideoCore IV...
-
fascinating:
https://github.com/wimrijnders/V3DLib/blob/main/Doc/Basics.md
sharing is caring
-
I built v3dlib on piCore64 - all the tests pass and ./obj/qpu-debug/bin/GCD runs.
sudo ./obj/qpu-debug/bin/detectPlatform
Platform : Raspberry Pi 4 Model B Rev 1.4
Model Number: BCM2711
Revision : d03114
This is a pi platform.
GPU: v3d (VideoCore VI)
-
On piCore/RPi3 several of the tests fail with:
FATAL: Failed to allocate vc4 shared memory
..but that might be addressed with something in config.txt
sudo ./obj/qpu-debug/bin/detectPlatform
Platform : Raspberry Pi 3 Model B Rev 1.2
Model Number: BCM2837
Revision : a02082
This is a pi platform.
GPU: vc4 (VideoCore IV)
-
If you let me know how you tested https://github.com/wimrijnders/V3DLib I can give it a try although it might not be relevent to VideoCore IV...
I'm using a RPi02W (armv7) with PiCore 13.
My cmdline.txt:
zswap.compressor=lz4 zswap.zpool=z3fold console=tty0 root=/dev/ram0 elevator=deadline rootwait quiet nortc loglevel=3 noembed
My onboot.lst: https://pastebin.com/VkBcqcUJ
My config.txt: https://pastebin.com/5nVHnVui
Here is what I did. Loading the programming packages:
#loading general programming packages
tce-load -i compiletc git
#loading specific packages used by V3DLib
tce-load -i expat2-dev rpi-vc-dev
Then I cloned V3DLib and its dependency CmdParameter, and I applied the change described in https://github.com/wimrijnders/V3DLib/issues/7
Compiling:
#compiling CmdParameter
cd CmdParameter
make DEBUG=1 all
cd ..
#compiling V3DLib and running the tests (all tests fail)
cd V3DLib
make QPU=1 DEBUG=1 test
#running the tests as root (to see if there is any difference. also fail)
sudo su
./obj/qpu-debug/bin/runTests
Here are the results of the tests: https://pastebin.com/uqbZWLhc
detectPlatform seems to work:
sudo ./obj/qpu-debug/bin/detectPlatform
Platform : Raspberry Pi Zero 2 W Rev 1.0
Model Number: BCM2837
Revision : 902120
This is a pi platform.
GPU: vc4 (VideoCore IV)
-
Do you need graphics-KERNEL loaded and the following in config.txt:
[PI02]
dtoverlay=vc4-kms-v3d
..maybe also rpi-vc?
-
Do you need graphics-KERNEL loaded and the following in config.txt:
[PI02]
dtoverlay=vc4-kms-v3d
..maybe also rpi-vc?
I tried adding:
graphics-5.10.77-piCore-v7.tcz
rpi-vc.tcz
at the top of my onboot.lst file, and:
dtoverlay=vc4-kms-v3d
gpu_mem=256
at the bottom of my config.txt.
The "ioctl_set_msg failed: -1" error message and memory allocation problems seem to have disappeared, but the tests are still failing:
ERROR: test case THREW exception: FATAL: Unable to enable QPUs. Check your firmware is latest.
-
After adding gpu_mem=128 I get the same firmware error on the RPi3/piCore.
On the RPi4/piCore64 all tests pass.
Maybe you could report it as an issue at https://github.com/wimrijnders/V3DLib/issues
-
Maybe you could report it as an issue at https://github.com/wimrijnders/V3DLib/issues
I think it is a good idea, but first it would nice to test it with Raspbian 10 Buster to verify if this issue is not related to tinycore. E.g. maybe graphics-KERNEL.tcz or rpi-vc.tcz could be updated? I'm gonna try it with my Pi if I have some time.