Skip to content

MaveriQ/py-videocore

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyVideoCore

This is work in progress project. Backward compatibility is not guaranteed.

PyVideoCore is a Python library for GPGPU on Raspberry Pi boards. The Raspberry Pi SoC integrates Broadcom VideoCore IV graphics core. It has 12 quad processor units (QPU) which is a dual-issue 16 way (4 way pipelined and 4 way true) SIMD processor. Read the following guide thoroughly to study its architecture.

As far as I know, modern GPGPU programming environments such as OpenCL do not exist for VideoCore. Assembly programming is the only option at this moment and several QPU assemblers written by pioneers (hermanhermitage, petewarden, elorimer and so on) are available.

PyVideoCore's QPU assembler is different from theirs in terms of that its assembly language is implemented as an Internal DSL of Python language. This makes GPGPU programming on Raspberry Pi relatively easier in the sense that

  • You can put host programs and GPU side programs in a single Python script.
  • You can execute the program without ahead-of-time compilation.
  • You can utilize Python functionality, libraries and tools to organize GPU programs.

Requirements

  • Raspberry Pi or Pi 2
  • Python 2 (>= 2.6) or Python 3
  • NumPy
  • nose (if you want to run tests)

Installation

$ git clone https://github.com/nineties/py-videocore.git
$ cd py-videocore
$ sudo python setup.py install

You might need to update firmware.

$ sudo rpi-update

You can increase GPU memory size by raspi-config.

$ sudo raspi-config

Be Careful

  • You need to run programs as a super user so that this library can access /dev/mem.
  • Accessing wrong location of /dev/mem, due to a bug of this library or your program, may make your system unstable or could break your machine.

Getting Started

$ sudo python examples/hello_world.py

Running Tests

sudo nosetests -v

Documentation

TBD

Tutorials

In japanese.

Records

- Achieved 8GFlops with sgemm. .. image:: https://pbs.twimg.com/media/CWYjkH7U4AAh9VE.jpg

License

Code and documentation are released under MIT license



  1. Supplementary information and errata list.

About

Python library for GPGPU on Raspberry Pi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%