Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to use the GPU for calculations? (e.g. CUDA/OpenCL)

share|improve this question
up vote 58 down vote accepted

At the moment your best bet is to implement your computation as a fragment shader in GLSL ES and find a way to represent the output as a RGBA (32-bit) texture.

Eben states in this talk that OpenCL is not likely to be implemented, but that there may be an API developed in the future; the answer starts at 21:20, and Eben says "we may provide some way for people to get some of that general purpose compute out".

share|improve this answer
6  
AFAIK that talk is the most definitive answer so far... the answer starts at 21:20, and Eben says "we may provide some way for people to get some of that general purpose compute out" – je4d Jun 12 '12 at 22:31
4  
Some of the GPU code has been opensourced! github.com/raspberrypi/userland – John La Rooy Oct 25 '12 at 0:14
    
It is equivalent to implementing OpenCL, as someone can just add a VideoCore OpenCL backend to LLVM to compile OpenCL to VC. – Maxthon Chan Apr 11 '15 at 4:58
    
The situtation has changed in 2014 with the official release of documentation and various blogposts about GPGPU on the official blog itself. – flakeshake Jan 11 at 13:22

Not at present - there is only a framebuffer interface for display purposes. There is no OpenCL and no plans for it nor is there documentation available to create OpenCL. CUDA is Nvida only so isn't applicable. Once an OpenGL driver becomes available you may be able to engineer some calculations via the GPU but how useful that will be remains to be seen.

Check out this detailed thread on the RPi forum: GPU Processing API

share|improve this answer
    
+1 - Interesting link – Greenonline Feb 25 '15 at 1:06

This one may be useful.. GPGPU python library for the raspberry pi. https://github.com/nineties/py-videocore

A general-purpose GPU (GPGPU) is a graphics processing unit (GPU) that performs non-specialized calculations that would typically be conducted by the CPU

share|improve this answer

The Raspberry Pi foundation has been endorsing GPGPU on the Pi since 2014 , shortly after Broadcom released documentation for the QPU units inside the GPU.

An experimental OpenCL compiler was created by Simon J. Hall (the winner of the tightly related 2014 10,000 $ competition to make Quake run acceptably without using the GPU BLOB) : see here.

share|improve this answer

You can write high-level programs that run on the Pi's GPU using QPULib:

https://github.com/mn416/QPULib

It's a programming language and compiler targeting the 12 vector processors (QPUs) inside the Pi's GPU. It aims to be easy to use and is implemented as an EDSL (Embedded Domain Specific Language) -- a lightweight alternative to a full-blown OpenCL backend.

share|improve this answer

Check this https://www.parallella.org/

This is the best solution for your question

share|improve this answer
1  
Please include the relevant parts of the tutorial here, as to prevent link rot. – Bex Jul 12 '15 at 19:19
    
-1 Not seemingly related to the RPi! – SlySven Dec 28 '15 at 21:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.