# Error using P3D on Raspberry Pi

**URL:** https://discourse.processing.org/t/error-using-p3d-on-raspberry-pi/40285
**Category:** Processing for Pi
**Created:** [December 23, 2022, 10:54pm UTC](https://discourse.processing.org/t/error-using-p3d-on-raspberry-pi/40285 "2022-12-23T22:54:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pjyelton](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pjyelton](https://discourse.processing.org/u/pjyelton)
#### Post date: [December 23, 2022, 10:54pm UTC](https://discourse.processing.org/t/error-using-p3d-on-raspberry-pi/40285/1 "2022-12-23T22:54:36Z")

</div>

Been creating several 3D sketches successfully on my Windows machine, now trying to get them to run on a new Raspberry Pi 3B+ that I bought. Whenever I try to run a script I immediately get a segmentation error. Based on my research I believe its an issue with OpenGL but I don’t know how to possibly fix it.

For example, this simple code:  
void setup() {  
size(640,360,P3D);  
}  
void draw() {  
}

Gives error SIGSEGV Problematic Frame libjvm.so PhaseIdealLoop::build\_loop\_Late\_post\_work. Could not run the sketch (Target VM failed to initialize).

Running Processing 4.1.1 and on OS Raspbian GNU/Linux 11 (bullseye). Also please go easy on my with the Linux talk, this is my first experience using it, been strictly Windows before now. Thanks!

---

<div class="post-metadata">

### Author: ![f42ter](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/f42ter/32/16793_2.png) [@f42ter](https://discourse.processing.org/u/f42ter)
#### Post date: [January 4, 2023, 12:35pm UTC](https://discourse.processing.org/t/error-using-p3d-on-raspberry-pi/40285/2 "2023-01-04T12:35:01Z")

</div>

I’m on a PI 4+ and64-bit OS.

> pi@raspberrypi ~ $ uname -a  
> Linux raspberrypi 5.15.76-v8+ #1597 SMP PREEMPT Fri Nov 4 12:16:41 GMT 2022 aarch64 GNU/Linux

and Processing 4.0.1

and I have no problems wit P3D.  
So maybe, 4.1.1 is broken? Roll back to 4.0.1. You find it here

> **[Releases · benfry/processing4](https://github.com/benfry/processing4/releases)**
>
> Processing 4.x releases for Java 17. Contribute to benfry/processing4 development by creating an account on GitHub.

Search for 4.01 and then open Assets to download your version.

Here some sample code

```auto
float x,y,z; 

void setup() { 
 size(800,600, P3D);
 noStroke();
 fill(204);
 rectMode(CENTER);
 fill(51);
 stroke(255);
}

void draw() {
    background(0);
    lights();
    camera(width/2, height/2, (height/2) / tan(PI/6), width/2, height/2, 0,0,1,0);
    float ZZ = PI/100*z++;
    pushMatrix();
    translate(width/2, height/2, 0);
    rotateX(PI/8+ZZ/10); 
    rotateY(PI/3+ZZ/25); 
   
    pushMatrix();
 // rotateX(PI/8); 
 // rotateY(PI/8); 
    rotateZ(-PI); 
    stroke(255, 255, 255);
    fill(0,0,255,32);
    box(95,95,95);
 // rect(0,0,100,100); 
    popMatrix();
    pushMatrix();
// translate(100, 100, 0);
   rotateX(-PI/8); 
  // rotateY(-PI/8); 
    rotateY(-ZZ/2+PI/3); 
    fill(255,0,0,32);
    stroke(255, 0, 0);
    box(100,100,100);
  
    popMatrix();
    translate(100, 100, 0);
     pushMatrix();
 // rotateX(-PI/8); 
    //rotateY(-PI/8); 
    rotateY(-ZZ*.2); 
     rotateZ(-ZZ*.3); 
    fill(0,255,0,32);
    stroke(0, 255, 0);
    box(105,105,105);
    translate(100, 100, 0);
    popMatrix();
    fill(0,255,0,0);
    stroke(255, 255, 255);
    box(105,105,105); 
    popMatrix();   
}    

```

and the result

 ![P3D Sample](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/a/e/aeb41eeade0408ac9270e1c26d737098ba02428a.png)
