Skip to content

Add VC4CL OpenCL packages for Raspberry Pi VideoCore IV#78

Open
Foadsf wants to merge 4 commits intolure-sh:masterfrom
Foadsf:add-vc4cl-git
Open

Add VC4CL OpenCL packages for Raspberry Pi VideoCore IV#78
Foadsf wants to merge 4 commits intolure-sh:masterfrom
Foadsf:add-vc4cl-git

Conversation

@Foadsf
Copy link

@Foadsf Foadsf commented Jan 10, 2026

Adds four new LURE packages:

  • vc4c-stdlib-git: Standard library headers for VC4C compiler
  • vc4c-git: OpenCL to VideoCore IV compiler
  • vc4cl-git: OpenCL 1.2 runtime for VideoCore IV GPU
  • clinfo-git: OpenCL platform/device info tool

Key notes:

  • Only works on Raspberry Pi 1-3 (VideoCore IV)
  • Does NOT work on Pi 4/5 (different GPU)
  • 64-bit ARM (aarch64) has known SIGBUS issues
  • Requires 32-bit kernel or 32-bit Raspberry Pi OS
  • Use make -j1 on Pi 3B to avoid OOM during compilation
  • Debian version format requires versions starting with digit

See individual README.md files for detailed lessons learned.

Adds four new LURE packages:
- vc4c-stdlib-git: Standard library headers for VC4C compiler
- vc4c-git: OpenCL to VideoCore IV compiler
- vc4cl-git: OpenCL 1.2 runtime for VideoCore IV GPU
- clinfo-git: OpenCL platform/device info tool

Key notes:
- Only works on Raspberry Pi 1-3 (VideoCore IV)
- Does NOT work on Pi 4/5 (different GPU)
- 64-bit ARM (aarch64) has known SIGBUS issues
- Requires 32-bit kernel or 32-bit Raspberry Pi OS
- Use make -j1 on Pi 3B to avoid OOM during compilation
- Debian version format requires versions starting with digit

See individual README.md files for detailed lessons learned.
vc4c-git:
- Add VC4CL_STDLIB_DIR to point to installed stdlib headers
- Disable VC4CL_STDLIB_PRECOMPILE to avoid permission errors during build

vc4cl-git:
- Add ocl-icd-dev to build dependencies for ICD support
- Enable BUILD_ICD for proper OpenCL ICD loader integration
- Disable INCLUDE_COMPILER to avoid runtime crash in libVC4CC

Tested on Raspberry Pi 3B+ with 32-bit Bookworm. clinfo now works.
vc4cl-git:
- Enable BUILD_ICD for OpenCL ICD loader integration
- Enable INCLUDE_COMPILER for online kernel compilation
- Add ocl-icd-dev build dependency

Tested on Raspberry Pi 3B+ (32-bit Bookworm):
- clinfo detects VideoCore IV GPU
- Compiler Available: Yes
- Successfully compiled and executed vector_add kernel on GPU
- clinfo-git: OpenCL platform/device info tool
- vc4c-stdlib-git: VC4C standard library headers
- vc4c-git: VC4C OpenCL compiler (uses LLVM 14 for C++14 compatibility)
- vc4cl-git: VC4CL OpenCL runtime for VideoCore IV GPU

All packages build successfully on x86_64 (cross-platform).
Designed for Raspberry Pi 1-3 (not Pi 4/5).

Key fixes:
- Use LLVM 14 instead of LLVM 18 to avoid C++17/C++14 conflicts
- Use GCC compiler with LLVM 14 libraries
- Single-threaded builds to avoid OOM on Pi 3B
- Debian-compliant version format (0.0.0.r%s.%s)
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

Successfully merging this pull request may close these issues.

1 participant