# PVRTrace can not launch successfully

**URL:** <https://forums.imgtec.com/t/pvrtrace-can-not-launch-successfully/2337>\
**Category:** PowerVR Insider\
**Tags:** pvrtrace\
**Created:** [July 29, 2015, 10:13am UTC](https://forums.imgtec.com/t/pvrtrace-can-not-launch-successfully/2337 "2015-07-29T10:13:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![cgdeveloper](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@cgdeveloper](https://forums.imgtec.com/u/cgdeveloper)\
**Post date:** [July 29, 2015, 10:13am UTC](https://forums.imgtec.com/t/pvrtrace-can-not-launch-successfully/2337/1 "2015-07-29T10:13:35Z")

</div>

Hi,

I use the latest PVRTrace on a kind of Linux platform, seems it ignores LD\_LIBRARY\_PATH, I change to use LD\_PRELOAD or replace the interception so files with the so files in the BSP(TI SOC). It can work well for the generic linux app, but not work for the app which I use node(v8) to launch. For example:

1. export LD\_PRELOAD=/pvr/libEGL.so:/pvr/libGLESv2.so:/pvr/libGLESv1\_CM.so:/pvr/libGLES\_CM.so:/pvr/libPVRTrace.so
2. node --harmony index.js  
It will output the following errors:  
PVRTRACE(M) Config file found: /pvr/pvrtraceconfig.json

PVRTRACE(M) Opening trace file ‘/pvr/trace.pvrt’ for record recording.  
PVRTRACE(M) ‘/pvr/trace.pvrt’ already exists so will be overwritten.  
PVRTRACE(M) Recorder Version: 3.3@2964572  
PVRTRACE(M) Loading host library '/pvr/libEGL.so.1.9.6.0’  
PVRTRACE(M) Host library ‘/pvr/libEGL.so.1.9.6.0’ loaded  
PVR:(Warning): LoadWSModule: Window system module libpvrws\_KMS.so did not validate native display [98, /generic\_ws.c]  
PVR:(Warning): LoadWSModule: Window system module libpvrws\_WAYLAND.so did not validate native display [98, /generic\_ws.c]  
PVR:(Error): Couldn’t load WS module libpvrws\_OMAPDRI2.so [44, /generic\_ws.c]  
Aborted (core dumped)

What is wrong? Thanks!

The system info is as followings:  
Copyright © Imagination Technologies Ltd. All rights reserved.

- Support: [DevTech@imgtec.com](mailto:DevTech@imgtec.com)
- OS: Linux version 3.14.31-00055-g4478b10 (jenkins@ubuntu76) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #1 SMP PREEMPT Thu Jun 18 05:05:25 CST 2015
- Time (local): Sat Jan 1 00:41:09 2000 (00:41:09)
- Time (UTC): Sat Jan 1 00:41:09 2000 (00:41:09)
- DRIVER BUILD: 1.9.225.3347
- Device Variant: PowerVR SGX544MP2
- Device Series: PowerVR Series5XT
- Processor count: 2  
This server is dra7xx-evm:6520 (lo:127.0.0.1)…

---

<div class="post-metadata">

**Author:** ![PaulLy](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@PaulLy](https://forums.imgtec.com/u/PaulLy)\
**Post date:** [July 29, 2015, 12:53pm UTC](https://forums.imgtec.com/t/pvrtrace-can-not-launch-successfully/2337/2 "2015-07-29T12:53:26Z")

</div>

Could you attach your pvrtraceconfig.json?

---

<div class="post-metadata">

**Author:** ![cgdeveloper](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@cgdeveloper](https://forums.imgtec.com/u/cgdeveloper)\
**Post date:** [July 30, 2015, 12:05am UTC](https://forums.imgtec.com/t/pvrtrace-can-not-launch-successfully/2337/3 "2015-07-30T00:05:50Z")

</div>

It is :  
{  
“Debug”: {  
“Level”: 1  
},  
“Host”: {  
“EglLibraryPath”: “/usr/lib/libEGL.so”,  
“Es1LibraryPath”: “/usr/lib/libGLESv1\_CM.so”,  
“Es2LibraryPath”: “/usr/lib/libGLESv2.so”  
},  
“Tracing”: {  
“OutputFilename”: “/pvr/trace.pvrt”,  
“RecordData”: true,  
“OptimiseFileSize”: false,  
“StartFrame”: 0,  
“EndFrame”: 9,  
“ExitOnLastFrame”: true,  
“ClientBufferRecordFrequency”: 1,  
“SaveFrameBuffer”: false  
},  
“Profiling”: {  
“SoftwareCounters”: true,  
“FunctionTimelineLevel”: 1,  
“Enabled”: 0,  
“RenderstateOverride”: true  
},  
“Network”: {  
“Wait”: true,  
“Enabled”: false,  
“BufferSize”: 256  
}  
}

---

<div class="post-metadata">

**Author:** ![cgdeveloper](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@cgdeveloper](https://forums.imgtec.com/u/cgdeveloper)\
**Post date:** [July 30, 2015, 6:05am UTC](https://forums.imgtec.com/t/pvrtrace-can-not-launch-successfully/2337/4 "2015-07-30T06:05:16Z")

</div>

I find the error is because  
EGLDisplay eglDisplay = eglGetDisplay(nativeDisplay);  
return eglDisplay==0 and then fire an assert.

but eglGetError() shows EGL\_SUCCESS, that means some error in the wrap layer in libEGL.so for node to launch the js. Any idea? Thanks!

---

<div class="post-metadata">

**Author:** ![PaulLy](https://avatars.discourse-cdn.com/v4/letter/p/958977/32.png) [@PaulLy](https://forums.imgtec.com/u/PaulLy)\
**Post date:** [July 30, 2015, 10:30am UTC](https://forums.imgtec.com/t/pvrtrace-can-not-launch-successfully/2337/5 "2015-07-30T10:30:57Z")

</div>

If you run the application with tracing enabled does it run without issue?

Could I also check that the drivers pointed to by your traceconfig are the host drivers, not the PVRTrace shims?

---

<div class="post-metadata">

**Author:** ![cgdeveloper](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@cgdeveloper](https://forums.imgtec.com/u/cgdeveloper)\
**Post date:** [August 3, 2015, 12:22am UTC](https://forums.imgtec.com/t/pvrtrace-can-not-launch-successfully/2337/6 "2015-08-03T00:22:24Z")

</div>

If I run the app without  
LD\_PRELOAD=/pvr/libEGL.so:/pvr/libGLESv2.so:/pvr/libGLESv1\_CM.so:/pvr/libGLES\_CM.so:/pvr/libPVRTrace.so  
it can run well.

I re-flash the whole image into the device and do not change any files under /usr/lib/. So the host driver should not be the PVRTrace ones. For example,  
lrwxrwxrwx 1 root root 11 Jan 1 00:03 /usr/lib/libEGL.so -\> libEGL.so.1  
lrwxrwxrwx 1 root root 17 Jan 1 00:02 /usr/lib/libEGL.so.1 -\> libEGL.so.1.9.6.0  
-rw-r–r-- 1 root root 21914 Jul 26 2015 /usr/lib/libEGL.so.1.9.6.0

I am sure there are some issues in PVRTrace’s libEGL.so, in which eglGetDisplay return 0 for node and the real eglGetDisplay is not executed.

Can you double check that if any error checking path leads to this issue?

---

<div class="post-metadata">

**Author:** ![cgdeveloper](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@cgdeveloper](https://forums.imgtec.com/u/cgdeveloper)\
**Post date:** [August 4, 2015, 12:35am UTC](https://forums.imgtec.com/t/pvrtrace-can-not-launch-successfully/2337/7 "2015-08-04T00:35:38Z")

</div>

I try to ignore libEGL.so and use  
LD\_PRELOAD=/pvr/libGLESv2.so:/pvr/libGLESv1\_CM.so:/pvr/libGLES\_CM.so:/pvr/libPVRTrace.so

and find eglGetDisplay can work well. But Segmentation fault in libPVRTrace.so:  
#0 0xb6f6b05e in std::map\<unsigned int, VAODefinition, std::less\<unsigned int\>, std::allocator\<std::pair\<unsigned int const, VAODefinition\> \> \>::operator[](unsigned int const&) ()  
from /opt/img-powervr-sdk/PVRHub/PVRTrace/Recorder/libPVRTrace.so  
#1 0xb6f5f09c in Es2::\_glBindBuffer(unsigned int, unsigned int) ()  
from /opt/img-powervr-sdk/PVRHub/PVRTrace/Recorder/libPVRTrace.so

This proves that is correct:  
“I am sure there are some issues in PVRTrace’s libEGL.so, in which eglGetDisplay return 0 for node and the real eglGetDisplay is not executed.”

---

<div class="post-metadata">

**Author:** ![szhipeng](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@szhipeng](https://forums.imgtec.com/u/szhipeng)\
**Post date:** [August 13, 2015, 1:18am UTC](https://forums.imgtec.com/t/pvrtrace-can-not-launch-successfully/2337/8 "2015-08-13T01:18:22Z")

</div>

Hi Oscar,  
I just tried  
export LD\_PRELOAD=/home/kevin/IMG\_SDK\_LIB/PVRTrace/Linux\_x86\_64/libGLESv2.so:/home/kevin/IMG\_SDK\_LIB/PVRTrace/Linux\_x86\_64/libGLESv1\_CM.so:/home/kevin/IMG\_SDK\_LIB/PVRTrace/Linux\_x86\_64/libGLES\_CM.so:/home/kevin/IMG\_SDK\_LIB/PVRTrace/Linux\_x86\_64/libPVRTrace.so

It is work fine on my  
Linux ImgBuild 3.13.0-55-generic #94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015 x86\_64 x86\_64 x86\_64 GNU/Linux

Thanks,  
Kevin

---

<div class="post-metadata">

**Author:** ![szhipeng](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@szhipeng](https://forums.imgtec.com/u/szhipeng)\
**Post date:** [August 13, 2015, 1:44am UTC](https://forums.imgtec.com/t/pvrtrace-can-not-launch-successfully/2337/9 "2015-08-13T01:44:03Z")

</div>

Hi Oscar,

According to your output:  
\>\>\>\>\>\>\>\>\>\>  
PVRTRACE(M) Recorder Version: 3.3@2964572  
PVRTRACE(M) Loading host library ‘/pvr/libEGL.so.1.9.6.0′  
PVRTRACE(M) Host library ‘/pvr/libEGL.so.1.9.6.0′ loaded  
\<\<\<\<\<\<\<\<\<\<  
and your pvrtraceconfig.json  
\>\>\>\>\>\>\>\>\>\>  
“EglLibraryPath”: “/usr/lib/libEGL.so”,  
\<\<\<\<\<\<\<\<\<\<  
Seem like you loaded wrong host library. the right output should be like this:  
\>\>\>\>\>\>\>\>\>\>  
Loading host library '/usr/lib/libGLESv2.so’  
Host library ‘/usr/lib/libGLESv2.so’ loaded  
\<\<\<\<\<\<\<\<\<\<  
Is that possible the program loaded a different json file?  
or can you try to change your json file like the following:  
\>\>\>\>\>\>\>\>\>\>  
“Host”: {  
“EglLibraryPath”: “/usr/lib/libEGL.so”,  
“Es1LibraryPath”: “/usr/lib/libGLES\_CM.so”,  
“Es2LibraryPath”: “/usr/lib/libGLESv2.so”  
},  
\<\<\<\<\<\<\<\<\<\<  
Thanks,  
Kevin
