Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable or bypass Hardware Graphics Acceleration(Prism) in JavaFX

Tags:

OS: OSX Mountain Lion.

System: Virtual BOX 4.2.6.

Java: 1.7.0.40-ea-b34

I want to disable hardware acceleration for my JAVAFX app because there is no HW acceleration on my system (mac). So when there is no HW acceleration I am getting fatal error on executing my JAVAFX App. The error related to "Prism Engine pipeline" and it happen when java trying to execute openGL native libs. So i want to disable the prism.

I see there is some vm args that control prism behavior like.. Dprism.forceGPU=true;

Is there anything like above to disable prism or openGL requesting?

The Fatal error (openGl related codes)

Stack: [0x000000016c8f9000,0x000000016c9f9000], sp=0x000000016c9f7f40, free space=1019k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [libobjc.A.dylib+0x639f] objc_msgSend_fixup+0x5f C [AppKit+0x28134c] -[NSOpenGLContext initWithFormat:shareContext:]+0xac C [libprism-es2.dylib+0x4e9f] createContext+0x1b3 C [libprism-es2.dylib+0x4729] Java_com_sun_prism_es2_gl_mac_MacGLFactory_nInitialize+0xa2 j com.sun.prism.es2.gl.mac.MacGLFactory.nInitialize([I)J+0 j com.sun.prism.es2.gl.mac.MacGLFactory.initialize(Ljava/lang/Class;Lcom/sun/prism/es2/gl/GLPixelFormat$Attributes;)Z+73 j com.sun.prism.es2.ES2Pipeline.<clinit>()V+54  
like image 944
Lalith J. Avatar asked Sep 12 '13 03:09

Lalith J.


People also ask

How do I turn off hardware graphic acceleration?

In the Settings menu, expand the “Advanced” drop-down section found in the left sidebar and then select “System.” Find the “Use hardware acceleration when available” setting. Toggle the switch to the “Off” position and then click “Relaunch” to apply the changes. Warning: Make sure you save anything you're working on.


1 Answers

The j2d graphics pipeline is kind of deprecated in JavaFX 8, so it's better to use the software pipeline: -Dprism.order=sw. To verify that you are actually using it you could switch on logging: -Dprism.verbose=true

like image 160
Petr Avatar answered Sep 27 '22 22:09

Petr