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.

TDA4VM: Processors forum

Part Number: TDA4VM

Hi  Ti's experts,

     we found any rendering abnormalities in the GPU after running our program multiple times for a long time(About two hours), like this,

      

     This phenomenon has now replicated three times,

     a)First time discovered on a real vehicle,Please refer to the attachment for the phenomenon , .After maintaining this for a long time, rotating at a certain angle and returning to normal, it no longer reappears.,     We also recorded PVRTune data0524-582.zip

     

     b)  The same phenomenon also appeared on the platform for the second time,the phenomenon of repeatedly running the program during this period is consistent, which lasted for about two minutes and then resumed

     c)  The phenomenon for the third and second times is consistent, but it shows anomalies in different areas

      

     The code implementation on our GPU is as follows. Can you help check if there are any issues?

      

// create Renderbuffer。
glGenRenderbuffers(1, &offscreen_fbo_depth);
glBindRenderbuffer(GL_RENDERBUFFER, offscreen_fbo_depth);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height);
glBindRenderbuffer(GL_RENDERBUFFER, 0);

// create Framebuffer。
glGenFramebuffers(1, &offscreen_fbo);
glBindFramebuffer(GL_FRAMEBUFFER, offscreen_fbo);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, offscreen_fbo_texture, 0);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, offscreen_fbo_depth);

if ((status = glCheckFramebufferStatus(GL_FRAMEBUFFER)) != GL_FRAMEBUFFER_COMPLETE) {
    LOG(ERROR)<<"glCheckFramebufferStatus returned error"<<status;
    return -1;
}


// Load 3D car model components and other data into VertexArray

glGenVertexArrays(1, &vao);
    glBindVertexArray(vao);

    //Allocate and assign three VBO to our handle (vertices, normals and texture coordinates)
    glGenBuffers(3, buffer);

    //store vertices into buffer
    glBindBuffer(GL_ARRAY_BUFFER, buffer[P_VERTEX]);
    glBufferData(GL_ARRAY_BUFFER, sizeof(Vertex) * count, vertices, GL_STATIC_DRAW);
    // vertices are on index 0 and contains three floats per vertex
    glVertexAttribPointer(GLuint(0), 3, GL_FLOAT, GL_FALSE, 0, 0);
    glEnableVertexAttribArray(0);

    //store normals into buffer
    glBindBuffer(GL_ARRAY_BUFFER, buffer[P_NORMAL]);
    glBufferData(GL_ARRAY_BUFFER, sizeof(Vertex) * count, normals, GL_STATIC_DRAW);
    // normals are on index 1 and contains three floats per vertex
    glVertexAttribPointer(GLuint(1), 3, GL_FLOAT, GL_FALSE, 0, 0);
    glEnableVertexAttribArray(1);

    //store texture coordinates
    glBindBuffer(GL_ARRAY_BUFFER, buffer[P_TEXCOORD]);    
    glBufferData(GL_ARRAY_BUFFER, sizeof(Coord) * count, texcoords, GL_STATIC_DRAW);

    //coordinates are on index 2 and contains two floats per vertex
    glVertexAttribPointer(GLuint(2), 2, GL_FLOAT, GL_FALSE, 0, 0);
    glEnableVertexAttribArray(2);

    glBindVertexArray(0);

      The program rendering process is as follows,

     

  • save  current Framebuffer

    GLint default_fbo;

    glGetIntegerv(GL_FRAMEBUFFER_BINDING, &default_fbo);

  • bind offscreen_fbo

    glBindFramebuffer(GL_FRAMEBUFFER, offscreen_fbo);

  • draw to the offscreen_fbo

       glBindVertexArray(vbo->GetVAO());

       glDrawArrays(GL_TRIANGLES, 0, vbo->GetCount());

       glBindVertexArray(0);

  • bind current Framebuffer

    glBindFramebuffer(GL_FRAMEBUFFER, default_fbo);

  • offscreen_fbo swap to default_fbo
  • run glFinish();

      

       This doesn't seem like a software issue, We speculate if there is a problem with the driver or hardware ?Have you encountered similar problems?

       Please help locate the cause of the problem, thanks!

  • To add, the SDK version we are using is 7.03, QNX

    Looking for your reply

  • Zhen,

    Firstly, I want to address that the QNX gpu driver is not provided by us, so it would be helpful to start a thread with QNX as well on this issue you are seeing as we do not have access to the source code for their driver.

    Do you see any other logs from the GPU driver when you see this issue? Usually we see logs dumped by the GPU driver when there is a driver/HW issue with it.

    Regards,

    Erick

  • Hi 

       Thanks for your reply.

       You made a great suggestion,we only obtained the PVRTune log,  Could you please Provide a method to dump the GPU driver logs ?

  • Zheng,

    I've written a small FAQ on gathering the logs here:

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1218307/faq-how-can-i-analyze-a-gpu-graphics-process-unit-driver-or-hardware-issue

    But in your situation, we won't be able to analyze these logs and I am not sure the method works for QNX.

    I would expect the logs would dump automatically when the issue occurs and not require manual dumping.

    Regards,

    Erick

  • Hi 

         I still have some questions. Could you please help me confirm, 

         The camera Imag we obtained from Capture Node is placed in DDR_SHARED_MEM, In fact, TDA4 does not allocate separate memory space for GPU in system_memory_map.html,  which memory map is allocated to the buffer in Opengl? A72 in QNX?

        Could memory of Opengl interact with DDR_SHARED_MEM?

         We call glRenderbufferStorage to request memory for some rendering operations. Is it suitable for TI's Openvx architecture?

         

          glGenFramebuffers(1, &fbo);
            glGenRenderbuffers(1, &rbo);
            glBindRenderbuffer(GL_RENDERBUFFER, rbo);
            glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA, 1920, 1080);
            glBindFramebuffer(GL_FRAMEBUFFER, fbo);
            glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo);

  • Hello Zheng,

    Actually, most of the "native" OpenGL calls use internal GPU allocated memory that cannot be shared. For example, if you read textures the usual way with glTexImage2D, it will be allocated internally by the GPU and we should not access that memory as there are no guarantees about what the driver might do with it.

    Instead, the driver provides APIs for using External memories like shared memories. And we use these in our SurroundView example in Vision Apps. Can you please take a look at that example, and look for the GL_TEXTURE_EXTERNAL_OES, which indicates how you can render through shared memories.

    Please let me know as you run into questions.

    Thanks,

    Erick