gpt4 book ai didi

JavaFX 0x300b : Could not get EGL surface

转载 作者:行者123 更新时间:2023-12-02 01:37:34 26 4
gpt4 key购买 nike

我正在尝试在嵌入式环境(buildroot)中的 raspaberry pi 3 上运行 javafx 示例,我想在没有 X 的情况下运行它。当我运行命令时:

/root/jre-13.0.1/bin/java  -Dfile.encoding=UTF-8 --add-modules javafx.controls,javafx.fxml -Dprism.verbose=true -Djavafx.verbose=true -Dglass.platform=Monocle -Dprism.order=es2 -Djava.library.path=/root/jre-13.0.1/lib/ -Dembedded=monocle   -jar /home/root/NetBeansProjects//JavaFXFXML/dist/JavaFXFXML.jar 

我收到以下错误:

cmd : cd '/home/root/NetBeansProjects//JavaFXFXML'; '/root/jre-13.0.1//bin/java'  -Dfile.encoding=UTF-8 --add-modules javafx.controls,javafx.fxml -Dprism.verbose=true -Djavafx.verbose=true -Dglass.platform=Monocle -Dprism.order=es2 -Djava.library.path=/root/jre-13.0.1/lib/ -Dembedded=monocle   -jar /home/root/NetBeansProjects//JavaFXFXML/dist/JavaFXFXML.jar 
JavaFX launchApplication method: launchMode=LM_JAR
Prism pipeline init order:
es2
Using Double Precision Marlin Rasterizer
Using dirty region optimizations
Using system sized mask for primitives
Not
f
orcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.es2.ES2Pipeline
Loading ES2 native library ... prism_es2_monocle
Loaded /root/jre-13.0.1/lib/libprism_es2_monocle.so from java.library.path
succeeded.
GLFactory using com.sun.prism.es2.MonocleGLFactory
Loaded /root/jre-13.0.1/lib/libglass_monocle.so from java.library.path
com.sun.glass.ui.monocle.GLException: 0x300b: Could not get EGL surface
at javafx.graphics/com.sun.glass.ui.monocle.AcceleratedScreen.<init>(Unknown Source)
at javafx.graphics/com.sun.glass.ui.monocle.NativePlatform.getAcceleratedScreen(Unknown Source)
at javafx.graphics/com.sun.prism.es2.MonocleGLFactory.initialize(Unknown Source)
at javafx.graphics/com.sun.prism.es2.ES2Pipeline.<clinit>(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at javafx.graphics/com.sun.prism.GraphicsPipeline.createPipeline(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
(X) Got class = class com.sun.prism.es2.ES2Pipeline
GraphicsPipeline.createPipeline: error initializing pipeline com.sun.prism.es2.ES2Pipeline
Graphics Device initialization failed for : es2

我运行了 hello_triangle 和 hello_dispmanx 示例来测试 GPU 加速,没有出现任何问题。不知道为什么我收到 无法获取 EGL surface 错误,有什么方法可以调试此错误

Java 设置:

# java --version
openjdk 13.0.1-BellSoft 2019-10-15
OpenJDK Runtime Environment (build 13.0.1-BellSoft+9)
OpenJDK Server VM (build 13.0.1-BellSoft+9, mixed mode)

最佳答案

我终于明白了...由于我使用的是 buildroot,所有树莓派用户区 (GPU) 库都位于 /usr/lib 文件夹中。然而,深入研究 monocle 源代码,更准确地说是 DispmanPlatformFactory.java ,我们可以看到他们匹配平台的方式是在/opt/vc/lib中搜索libbcm_host.so,该so在buildroot配置中不存在。对于使用 buildroot 的人来说,一个快速解决方法是在 /opt/vc/lib

中创建一个指向 libbcm_host.so 的符号链接(symbolic link)

关于JavaFX 0x300b : Could not get EGL surface,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59567439/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com