# When using P3D: "Could not run the sketch (Target VM failed to initialize)"

**URL:** <https://discourse.processing.org/t/when-using-p3d-could-not-run-the-sketch-target-vm-failed-to-initialize/8103>\
**Category:** Processing\
**Created:** [February 4, 2019, 4:05pm UTC](https://discourse.processing.org/t/when-using-p3d-could-not-run-the-sketch-target-vm-failed-to-initialize/8103 "2019-02-04T16:05:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![companje](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/companje/32/2418_2.png) [@companje](https://discourse.processing.org/u/companje)\
**Post date:** [February 4, 2019, 4:05pm UTC](https://discourse.processing.org/t/when-using-p3d-could-not-run-the-sketch-target-vm-failed-to-initialize/8103/1 "2019-02-04T16:05:10Z")

</div>

Hi, since about a week I’m not able to run any sketches anymore in P3D mode on my Windows machine with Intel i5 6200U and HD 520 onboard graphics card. It has probably to do with the graphics driver after an automatic Windows Update but I can’t find a solution for it. I tried different versions of Processing (from 3.5.3 back to 3.4). I tried other versions of the graphics driver without luck so far.

Any ideas?

 ![processing-bug](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/7143543db4c864b6f510e2ca5f091f00460002de.png)

 ![unnamed](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/f/f4a422dd0df7282bb7e5c295d5b97c6acf2d9260.png)

---

<div class="post-metadata">

**Author:** ![zmooo](https://avatars.discourse-cdn.com/v4/letter/z/ecccb3/32.png) [@zmooo](https://discourse.processing.org/u/zmooo)\
**Post date:** [July 10, 2019, 1:47am UTC](https://discourse.processing.org/t/when-using-p3d-could-not-run-the-sketch-target-vm-failed-to-initialize/8103/2 "2019-07-10T01:47:55Z")

</div>

Hi,  
I am having the same error with my processing now. Did you fix this? If so can you give some hint?  
Thank you so much!

---

<div class="post-metadata">

**Author:** ![zmooo](https://avatars.discourse-cdn.com/v4/letter/z/ecccb3/32.png) [@zmooo](https://discourse.processing.org/u/zmooo)\
**Post date:** [July 10, 2019, 2:02am UTC](https://discourse.processing.org/t/when-using-p3d-could-not-run-the-sketch-target-vm-failed-to-initialize/8103/3 "2019-07-10T02:02:04Z")

</div>

ohhhh I know why, I was using the 32bit version, after download 64-bit version, it now works fine

---

<div class="post-metadata">

**Author:** ![companje](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/companje/32/2418_2.png) [@companje](https://discourse.processing.org/u/companje)\
**Post date:** [August 22, 2019, 9:35pm UTC](https://discourse.processing.org/t/when-using-p3d-could-not-run-the-sketch-target-vm-failed-to-initialize/8103/4 "2019-08-22T21:35:43Z")

</div>

Last time I checked (a week ago) the problem still persisted. I will check if your solution works for me. The weird thing is that it worked fine until at some day it stopped working.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [August 24, 2019, 8:48am UTC](https://discourse.processing.org/t/when-using-p3d-could-not-run-the-sketch-target-vm-failed-to-initialize/8103/5 "2019-08-24T08:48:45Z")

</div>

I had similar issues.

It improved with:

- have size() as first line in setup () and nothing before

- especially don’t load anything before setup and before size

- don’t use createFont loadFont and anything to do with the hard drive before setup and before size

- restart processing or computer

Best, Chrisir

---

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [August 24, 2019, 10:56am UTC](https://discourse.processing.org/t/when-using-p3d-could-not-run-the-sketch-target-vm-failed-to-initialize/8103/6 "2019-08-24T10:56:25Z")

</div>

I suspect that if you used

```java
void settings(){
  size(200, 200, P3D);
}

```

rather than declare size in setup, processing pre-processes the size from setup (if first line in setup) to settings anyway.

You would be OK

In [JRubyArt](http://ruby-processing.github.io/JRubyArt/processing-api/) I do this because its actually quite simple to do.

---

<div class="post-metadata">

**Author:** ![zang](https://avatars.discourse-cdn.com/v4/letter/z/bc8723/32.png) [@zang](https://discourse.processing.org/u/zang)\
**Post date:** [June 6, 2021, 7:30am UTC](https://discourse.processing.org/t/when-using-p3d-could-not-run-the-sketch-target-vm-failed-to-initialize/8103/7 "2021-06-06T07:30:29Z")

</div>

same problem ！how to fix it  
win 10  
.gtx 2080max q  
…\* NVIDIA 26.21.14.4219  
processing 3.5.4

---

<div class="post-metadata">

**Author:** ![zang](https://avatars.discourse-cdn.com/v4/letter/z/bc8723/32.png) [@zang](https://discourse.processing.org/u/zang)\
**Post date:** [June 6, 2021, 7:32am UTC](https://discourse.processing.org/t/when-using-p3d-could-not-run-the-sketch-target-vm-failed-to-initialize/8103/8 "2021-06-06T07:32:15Z")

</div>

i try them all  
not worked 😭

---

<div class="post-metadata">

**Author:** ![zang](https://avatars.discourse-cdn.com/v4/letter/z/bc8723/32.png) [@zang](https://discourse.processing.org/u/zang)\
**Post date:** [June 6, 2021, 7:44am UTC](https://discourse.processing.org/t/when-using-p3d-could-not-run-the-sketch-target-vm-failed-to-initialize/8103/9 "2021-06-06T07:44:44Z")

</div>

thanks i fix it!thanks
