This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
could you kindly give some info about the GPU performance? since my app break down when openGL render eight images to frameBuffer, every image file is .jpg format, the resolution is 1280*720 and size is 450KBytes, the openGL would render every image to icon size area(width: 150pixels and height 100pixels).
almost in every time, the app would break down once openGL call glDrawArrays func to draw image. the render frequency is about 25fps, since the data is not very big, and i think that work loading of openGL is not heavy. so the question is why app breaks down and what's the limitation of GPU performance and resource.
btw, operation steps when openGL render the screen:
1, load 8 pictures from tf card which mounted on the board, load one picture and render one icon, and repeat this procedure;
2, don't resize the jpg image before openGL render it, resizing image is finished by openGL.
thanks in advance.
BR.
想了解一下GPU的性能,目前板子上的一个应用程序,在渲染8幅图像时会崩溃,这些图像是 jpg格式,分辨率 1280*720,文件大小 450KBytes,openGL 会把这些图像渲染成缩略图,尺寸150*100, 渲染频率 25fps;
几乎每一次 openGL 调用 glDrawArrays 进行渲染时就会崩溃,因为图像数据量不是特别大,渲染的工作量也不会太大,所以想知道GPU的性能和资源,以及 app 崩溃的原因。
渲染时具体要做的事情:
头一次渲染时,依次从 板子上的 tf 卡中,加载8幅图像,加载一幅,渲染一幅;
把1280*720 的jpg图像,渲染成 缩略图时,事先没有经过缩放,缩放是通过 openGL 完成的;
感谢!
Hi we have received your question and feedback to the engineer, please expect the response. Thanks!
Hi,
Sorry for the delay response. And the issue description is not very clear.
What exact do you mean by app would break down once OpenGL call glDrawArrays?
Is there a reference to a testcase that can be reproduced on the TI EVM? Or some logs to indicate the problem?
We need a reference testcase or logs or a clear description of the problem to proceed.
Thanks and Best Regards,
Cherry
Hello,
nice to hear from you, and thanks for your advice.
maybe my descprition on this issue is not clear, and I rearrange the question as below:
1, the usecase (partly) which app used:
Capture -> Dup
Dup -> Sync_disp -> Gate_camera_display -> Merge_display -> SgxFrmcpy (A15) -> Display
in SgxFrmCpy link, I put the frameRender function in SgxFrmCpy processFrame function, i.e. SgxFrmCpy link would call frameRender function to render the screen, such as the video captured by cameras and ui widgets which rendered by openGL in this function when SgxFrmCpy link get new data from previous link.
2,the app could process user's touch operation on touch screen, and switch to responding ui, that means frameRender could render different ui widgets when sgxFrmCpy link receive new image data.
3,the app would break down when frameRender function try to render the setting ui widgets almost on every time.
4,when app breaks down, I found it's call openGL glDrawArrays function to render some icons.
5, the icon comes from jpg image file in tf card which mounted on board, the processdure as below:
1, read image from tfcard;
2, bind the image to tex (a data struct which is used to render iamge and word);
3, call openGL api function to render the image as icon, resize the image and draw on the framebuffer;
6,there are 8 icons need to render, but app is always killed by linux os. so, I wanna know the details and performance of GPU.
thanks in advance.
BR.
ohenry
btw:
this is the function to render the icons:
void className::fixed_paint_tex(TEX tex,float px,float py,float lx,float ly,float xx,float yy,float winWidth,float winHeight,float width,float height,bool stretch,float angle,float opacity)
{
GLboolean cull_enable=glIsEnabled(GL_CULL_FACE );
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
float x0,y0,x1,y1;
if(stretch){
x0=(xx-winWidth/2)/(winWidth/2);
y0=(winHeight/2-yy)/(winHeight/2);
x1=(xx+width-winWidth/2)/(winWidth/2);
y1=(winHeight/2-(yy+height))/(winHeight/2);
}else{
x0=(xx-winWidth/2)/(winWidth/2);
y0=(winHeight/2-yy)/(winHeight/2);
x1=(xx+lx-winWidth/2)/(winWidth/2);
y1=(winHeight/2-(yy+ly))/(winHeight/2);
}
//////////////////////////////////////////////////////////////////
float vertices[30+1]={
x0, y0, -0.1, px/(float)tex.tex_width, py/(float)tex.tex_height, // 0 2/3
x0, y1, -0.1, px/(float)tex.tex_width, (py+ly)/(float)tex.tex_height, //
x1, y0, -0.1, (px+lx)/(float)tex.tex_width, py/(float)tex.tex_height, //
x1, y0, -0.1, (px+lx)/(float)tex.tex_width, py/(float)tex.tex_height, //
x0, y1, -0.1, px/(float)tex.tex_width, (py+ly)/(float)tex.tex_height, //
x1, y1, -0.1, (px+lx)/(float)tex.tex_width, (py+ly)/(float)tex.tex_height, // 1/4 5
0
};
float arc_angle=angle*M_PI/180.0f;
float mid_x=(x0+x1)/2.0;
float mid_y=(y0+y1)/2.0;
if(angle > 0.000001 || angle < -0.000001) /* omit calculation when angle == 0; */
{
for(int i=0;i<30;i+=5)
{
xx=(vertices[i]-mid_x)*cos(arc_angle)-(vertices[i+1]-mid_y)*sin(arc_angle)+mid_x;
yy=(vertices[i]-mid_x)*sin(arc_angle)+(vertices[i+1]-mid_y)*cos(arc_angle)+mid_y;
vertices[i]=xx;
vertices[i+1]=yy;
}
}
GLuint program = shaderObj->get_program();
glUseProgram(program);
glUniform1i(glGetUniformLocation(program, "sTexture"), 0);
glUniform1f(glGetUniformLocation(program, "opacity"), opacity);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, tex.texid);
glDisable(GL_DEPTH_TEST);
if(b_blend)
{
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
else
glDisable(GL_BLEND);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
glEnableVertexAttribArray(0);
glEnableVertexAttribArray(1);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 20, vertices);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 20, vertices+3);
glDrawArrays(GL_TRIANGLES, 0, 6); /* app breaks down when calls this function. */
glDisableVertexAttribArray(0);
glDisableVertexAttribArray(1);
if(cull_enable)
glEnable(GL_CULL_FACE);
else
glDisable(GL_CULL_FACE);
}
FYI.
Hi Dear,
Sorry for the delay response here.
What does app breakdown mean?
Are you getting GPU crash or Linux Kernel panic?
Do you have some logs with the errors?
Thanks!
Hi,
Nice to hear from you.
below is app break down log.
apps_jh6.out is the app name.
when app calls the gldrawArrays(...) func, it breaks down and log printed as below.
linux kernel is unstable when app breaks down. it means that sometimes linux kernel breaks down either and resart, and sometimes, app halt, but linux still works well.
FYI.
thanks and best regards!
[ 1858.599018] apps_jh6.out invoked oom-killer: gfp_mask=0x24000c4, order=0, oom_score_adj=0
[ 1858.600066] apps_jh6.out cpuset=/ mems_allowed=0
Hi Henry,
Sorry for the delay in response.
This issue doesn't have anything to do with GPU performance.
From the trace, it looks like memory allocation issue.
Was the SGX framecopy use case working before you added their changes?
Regards,
Cherry
Hi, Cherry,
Thanks for your kindly reply.
and i think the answer is right. since low mem is used up, then the oom-killer kills the process (apps_jh6.out).
since sr1 is about 300MB which in low mem region, and for linux kernel, the available memory space is limited.
so, when apps_jh6.out apply for mem to display the scaled image, the low mem is up, and oom-killer actions.
thanks.
BR.