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: EGL: ERROR: eglInitialize() failed !!!

Part Number: TDA4VM

Hi,

TI experts, 

Now I try to use srv camera demo on our custom board and our sdk version is 0805. But when the code reaches eglInitialize(), the following error occurs: 

libEGL warning: MESA-LOADER: failed to open swrast (search paths /usr/lib/dri)

EGL: eglInitialize() returned 0
EGL: after eglInitialize() eglError (0x3001)
EGL: ERROR: eglInitialize() failed !!!
  1537.428308 s:  VX_ZONE_ERROR:[tivxOpenglGlSrvEglInfo:150] GL SRV: ERROR: Couldn't open egl window!

Then I check dmesg log,  it seems that the GPU driver has already been installed.

root@optimus:/# dmesg |grep PVR
[    7.706232] PVR_K:  203: Read BVNC 22.104.208.318 from HW device registers
[    7.720330] PVR_K:  203: RGX Device registered with BVNC 22.104.208.318
[   75.598297] PVR_K:  14527: RGX Firmware image 'rgx.fw.22.104.208.318' loaded
root@optimus:/# dmesg |grep gpu
[    7.758161] [drm] Initialized pvr 1.13.5776728 20170530 for 4e20000000.gpu on minor 0

How can I initialize opengl properly ?

  • Hello,

    The SDK demos are tested so that they work out-of-the-box. This seems to be an issue with the state of the driver or it's support.

    What changes have you made to the filesystem, if any?

    And is your current display that is connected using the R5 rendering? Or do you see the weston homescreen?

    Please also run "rgx_compute_test" as a sanity check that the GPU driver is working.

    Regards,

    Erick

  • Hi, Erick, 

    What changes have you made to the filesystem, if any?

    I'm not sure is there anything different. Could you help list the dependencies required for running GPU and libEGL on the 0805 SDK? I'll check if there's anything missing or if the version is consistent.

    And is your current display that is connected using the R5 rendering? Or do you see the weston homescreen?

    I use the DP connected monitor directly and I can see display like this:

    Please also run "rgx_compute_test" as a sanity check that the GPU driver is working.

    Here is the running result, please help check. 

    root@optimus:/data# rgx_compute_test
    ------------------ RGX compute test -----------------
    ----------------------- Start -----------------------
    Call PVRSRVConnectionCreateDevice with a valid argument:
    Connecting to first (0) default pvr device
     OK
    Create dev var context:
     OK
    Looking up General heap handle
     OK
    Getting event object
     OK
    Creating robustness buffer
     OK
    Mapping robustness buffer
     OK
    Creating Compute Context
     OK
    Creating Buffer
    Creating DWord for CDM Event Object
     OK
     OK
    Create PDS Heap
     OK
    Create USC Heap
     OK
    Reset event object value
    Creating NOP instruction
    Creating Data Segment
    Creating Code Segment
    Write Kernel 0
    Creating Fence Data Segment
    Creating Code Segment
    Write Fence Kernel
    Write Terminate
    Call services to kick CDM
     OK
    Poll for CDM event object data
    Event object value: 0xa1b2c3d4
     OK
     OK
    Destroy Compute Context
     OK
    
    Total time: 1ms
    Disconnect from services:
     OK
    ------------------------ End ------------------------

    Thank you. 

  • Hi,

    I'm not sure is there anything different. Could you help list the dependencies required for running GPU and libEGL on the 0805 SDK? I'll check if there's anything missing or if the version is consistent.

    It looks like you have the dependencies for the GPU driver to be running, so this is fine.

    I use the DP connected monitor directly and I can see display like this:

    This means your display is working (R5 based).

    The last step is to see why the GPU won't render to the framebuffer. Did you build your filesystem with Yocto? The default SDK will work out of the box, but if the configuration or GPU driver used is different, it can cause issues. Especially if it's pulling some of the latest changes we made to the driver.

    I'll check SDK 8.5 Vision Apps on my side to see if the same error is present. Meanwhile, can you also check one of the other GPU applications? Like this one:

    https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/08_06_00_12/exports/docs/vision_apps/docs/user_guide/group_apps_basic_demos_app_arm_mosaic.html

    To see if you get the same error.

    Thanks,

    Erick

  • Hi, Eirck,

    Did you build your filesystem with Yocto?

    Yes, I use a Yocto project to build filesystem. 

    but if the configuration or GPU driver used is different, it can cause issues.

    Is the configuration you said here refer to the Linux kernel configuration? 

    Does “GPU driver” refer to ti-img-rogue-driver? I have already integrated the ti-img-rogue-driver_1.15.6133109.bb and ti-img-rogue-umlibs_1.15.6133109.bb in my Yocto project and I did not make any changes. 

    To see if you get the same error.

    Yes, there is the same error: 

    root@optimus:/data# ./vx_app_arm_opengl_mosaic.out
    Test data path is NULL. Defaulting to current folder
    APP: Init ... !!!
    MEM: Init ... !!!
    MEM: Initialized DMA HEAP (fd=4) !!!
    MEM: Init ... Done !!!
    IPC: Init ... !!!
    IPC: Init ... Done !!!
    REMOTE_SERVICE: Init ... !!!
    REMOTE_SERVICE: Init ... Done !!!
     10209.441509 s: GTC Frequency = 200 MHz
    APP: Init ... Done !!!
     10209.441582 s:  VX_ZONE_INIT:Enabled
     10209.441593 s:  VX_ZONE_ERROR:Enabled
     10209.441600 s:  VX_ZONE_WARNING:Enabled
     10209.444302 s:  VX_ZONE_INIT:[tivxInitLocal:145] Initialization Done !!!
     10209.444580 s:  VX_ZONE_INIT:[tivxHostInitLocal:93] Initialization Done for HOST !!!
    libEGL warning: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/dri)
    
    EGL: eglInitialize() returned 0
    EGL: after eglInitialize() eglError (0x3001)
    EGL: ERROR: eglInitialize() failed !!!
     10209.477582 s:  VX_ZONE_ERROR:[tivxOpenglMosaicProcessEglInfo:352] OpenGL Mosaic: ERROR: Couldn't open openGL window!
    Segmentation fault (core dumped)

    Thank you,

     Muqun

  • Muqun,

    Are you trying to use the SDK 8.5 configuration file for the Yocto build? I'm see a discrepancy in the GPU driver version that we used in the SDK (1.15) and the one reported in your system. Can you send the dmesg logs? I think it is loading 1.13, which might be causing some issues.

    Does “GPU driver” refer to ti-img-rogue-driver? I have already integrated the ti-img-rogue-driver_1.15.6133109.bb and ti-img-rogue-umlibs_1.15.6133109.bb in my Yocto project and I did not make any changes. 

    Regards,

    Erick

  • Hi, Erick,

    Thanks for finding this problem. Now I have corrected the problem, but the error still exists.

    The dmesg log shows that it is loading 1.15: 

    root@optimus:/# dmesg |grep PVR
    [    7.788448] PVR_K:  207: Read BVNC 22.104.208.318 from HW device registers
    [    8.084593] PVR_K:  207: RGX Device registered with BVNC 22.104.208.318
    [  109.758524] PVR_K:  1777: RGX Firmware image 'rgx.fw.22.104.208.318.64k' loaded
    [  109.772137] PVR_K:  1777: Shader binary image 'rgx.sh.22.104.208.318' loaded
    root@optimus:/# dmesg |grep gpu
    [    7.726795] pvrsrvkm 4e20000000.gpu: More than one power domain for this GPU, gpu driver manages power domains
    [    8.178182] [drm] Initialized pvr 1.15.6133109 20170530 for 4e20000000.gpu on minor 0

    I run rgx_compute_test again: 

    root@optimus:/# rgx_compute_test
    ------------------ RGX compute test -----------------
    ----------------------- Start -----------------------
    Call PVRSRVConnectionCreateDevice with a valid argument:
    Connecting to first (0) default pvr device
     OK
    Create dev var context:
     OK
    Looking up General heap handle
     OK
    Getting event object
     OK
    Creating robustness buffer
     OK
    Mapping robustness buffer
     OK
    Creating Compute Context
     OK
    Creating Buffer
    Creating DWord for CDM Event Object
     OK
     OK
    Create PDS Heap
     OK
    Create USC Heap
     OK
    Reset event object value
    Creating NOP instruction
    Creating Data Segment
    Creating Code Segment
    Write Kernel 0
    Creating Fence Data Segment
    Creating Code Segment
    Write Fence Kernel
    Write Terminate
    Call services to kick CDM
     OK
    Poll for CDM event object data
    Event object value: 0xa1b2c3d4
     OK
     OK
    Destroy Compute Context
     OK
    
    Total time: 1ms
    Disconnect from services:
     OK
    ------------------------ End ------------------------

    Then I find that this two logs

    [ 109.758524] PVR_K: 1777: RGX Firmware image 'rgx.fw.22.104.208.318.64k' loaded
    [ 109.772137] PVR_K: 1777: Shader binary image 'rgx.sh.22.104.208.318' loaded

    appear after I run rgx_compute_test, will this have any impact?

    Then I run vx_app_arm_opengl_mosaic.out again, however, the error still exists. 

    Thank you,

    Muqun

  • Muqun,

    Then I find that this two logs

    [ 109.758524] PVR_K: 1777: RGX Firmware image 'rgx.fw.22.104.208.318.64k' loaded
    [ 109.772137] PVR_K: 1777: Shader binary image 'rgx.sh.22.104.208.318' loaded

    appear after I run rgx_compute_test, will this have any impact?

    This is OK, actually the GPU driver will only load the firmware until an application is run. The message coming through dmesg might take a bit longer since rgx_compute_test runs quickly.

    Then I run vx_app_arm_opengl_mosaic.out again, however, the error still exists. 

    Ok. Perhaps there is still something missing in the Yocto build. The default SDK image runs fine. Let me check if there are configuration options in Yocto that could be triggering the wrong Graphics driver options.

    Regards,

    Erick

  • Muqun,

    Can you please do the following to make sure we have the right libraries in your filesystem? Can you please copy over the UM libs into your filesystem and overwrite the ones existing:

    Clone this repository and copy the files into your filesystem:

    Repository: https://git.ti.com/cgit/graphics/ti-img-rogue-umlibs/?h=linuxws/dunfell/k5.10/1.15.6133109_unified_fw_pagesize

    File location for J721E: https://git.ti.com/cgit/graphics/ti-img-rogue-umlibs/tree/targetfs/j721e_linux/wayland/release?h=linuxws/dunfell/k5.10/1.15.6133109_unified_fw_pagesize

    Then try running your application again.

    Thanks,

    Erick

  • Hi, Erick, 

    I found the problem. There were some problems when building the Yocto project, and some .so files were not linked correctly, and pkgconfig is not packaged into the filesystem .

    Now after I manually add these files, the srv camera demo can run normally.

    Next I will go and see where there are problems with our Yocto project.

    Thanks a lot. 

    Best Regards,

    Muqun