获取GPU信息 --createWindowSurface EGL_BAD_NATIVE_WINDOW -- failed: EGL_BAD_MATCH
来源:互联网 发布:云存储使用的数据库 编辑:程序博客网 时间:2024/05/21 10:35
之前网上有很多关于获取GPU信息的帖子,大部分手机都可以获取到,但部分奇葩就不行了。
贴代码:
package com.example.gpuinfo;import javax.microedition.khronos.egl.EGLConfig;import javax.microedition.khronos.opengles.GL10;import android.app.Activity;import android.opengl.GLSurfaceView;import android.os.Bundle;import android.util.Log;public class OpenGlMainActivity extends Activity { private GLSurfaceView mGLSurfaceView; private class Renderer implements GLSurfaceView.Renderer { public void onDrawFrame(GL10 gl) { } public void onSurfaceChanged(GL10 gl, int width, int height) { } public void onSurfaceCreated(GL10 gl, EGLConfig config) { // 渲染器 Log.e( "GPUINFO", "GL_RENDERER:::::" + gl.glGetString( GL10.GL_RENDERER)); // 供应商 Log.e( "GPUINFO", "GL_VENDOR::::: " + gl.glGetString( GL10.GL_VENDOR)); // 版本 Log.e( "GPUINFO", "GL_VERSION::::: " + gl.glGetString( GL10.GL_VERSION)); } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate( savedInstanceState); // Create our surface view and set it as the content of our // Activity mGLSurfaceView = new GLSurfaceView( this); mGLSurfaceView.setRenderer( new Renderer()); setContentView( mGLSurfaceView); } @Override protected void onResume() { // Ideally a game should implement onResume() and onPause() // to take appropriate action when the activity looses focus super.onResume(); mGLSurfaceView.onResume(); } @Override protected void onPause() { // Ideally a game should implement onResume() and onPause() // to take appropriate action when the activity looses focus super.onPause(); mGLSurfaceView.onPause(); }}
经测试,三星一个2.2的pad(奇葩)可以获取,coolpad的一个奇葩也能获取,可能还有不能获取的机型,若有提出来大家一起解决。
- 获取GPU信息 --createWindowSurface EGL_BAD_NATIVE_WINDOW -- failed: EGL_BAD_MATCH
- android opengl: createWindowSurface returned EGL_BAD_NATIVE_WINDOW.
- 用NVAPI获取GPU信息
- CUDA中GPU信息获取
- Android createWindowSurface failed EGL_BAD_ALLOC 引起Crash的解决方案
- Android createWindowSurface failed EGL_BAD_ALLOC 引起Crash的解决方案
- 通过cuda获取GPU的信息
- C++之获取GPU(显卡)信息
- 获取android 设备的cpu gpu信息 mac地址
- 获取当前IOS设备的CPU型号,CPU核数,GPU,GPU核数,屏幕分辨率,屏幕尺寸,PPI等信息
- setEGLConfigChooser后导致EGL_BAD_MATCH
- tensorflow获取GPU设备
- Linux查看GPU相关信息
- LINUX 下查看GPU信息
- 查询gpu卡信息(nvidia)
- 查看GPU信息 nvidia-smi
- 我的GPU设备信息
- tensorflow获取可用GPU设备
- asp.net页面处理流程 - 1
- 从Spring 3.0升级到Spring 3.1
- 做开发的一个反思
- 一段代码实现天气预报在自己页面显示
- 优化UITableView性能
- 获取GPU信息 --createWindowSurface EGL_BAD_NATIVE_WINDOW -- failed: EGL_BAD_MATCH
- opencv入门一
- APPIUM移动自动化测试知多少?
- windows不能在本地计算机启动apache2.2解决
- android button的美化
- 深入理解C#的对象模型
- ext2.0中Record的使用(9)
- GNU ld链接脚本学习
- 一个字符串要变成回文串的需要添加的字符最少个数