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.
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.
- Raspberry Pi or Pi 2
- Python 2 (>= 2.6) or Python 3
- rpi-vcsm >= 2.0.0
- nose (if you want to run tests)
$ 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
$ sudo raspi-config
- You need to run programs as a super user so that this library can access
- 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.
$ sudo python examples/hello_world.py
sudo nosetests -v
- 128MB or more GPU memory is required to pass tests. Failed some tests with 64MB or less.
- Achieved 8GFlops with sgemm.
Code and documentation are released under MIT license
|||Supplementary information and errata list.|