cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

jirmik
Adept I

CodeXL GPU application trace command line arguments length

Hi,

we are working on a command-line tool which accepts many command-line arguments. In linux, it works OK when executed directly, but when we want to profile it, it gets stuck in first CL call when run under CodeXL remote agent in GPU application trace mode. Can't try locally with CodeXL, because we use our GPUs in headless servers. The backtrace looks like this:

#0  0x00007f056aa9603a in std::string::find(char const*, unsigned long) const () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6

#1  0x00007f0565a14eed in FileUtils::GetParametersFromFile(Parameters&) () from /opt/AMD/CodeXL_1.3.3487/bin/x86_64/libCLOccupancyAgent.so

#2  0x00007f0565a065d1 in clAgent_OnLoad () from /opt/AMD/CodeXL_1.3.3487/bin/x86_64/libCLOccupancyAgent.so

#3  0x00007f0567b39477 in ?? () from /usr/lib/libamdocl64.so

#4  0x00007f0567b39a30 in ?? () from /usr/lib/libamdocl64.so

#5  0x00007f0567b4e557 in ?? () from /usr/lib/libamdocl64.so

#6  0x00007f0567b1ae73 in clIcdGetPlatformIDsKHR () from /usr/lib/libamdocl64.so

#7  0x00007f056acfa5b2 in ?? () from /usr/lib/libOpenCL.so.1

#8  0x00007f056acfc986 in ?? () from /usr/lib/libOpenCL.so.1

#9  0x00007f056af0c400 in pthread_once () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S:104

#10 0x00007f056acfc747 in ?? () from /usr/lib/libOpenCL.so.1

#11 0x00007f056acfa7a5 in ?? () from /usr/lib/libOpenCL.so.1

#12 0x00007f056acfbf20 in clGetPlatformIDs () from /usr/lib/libOpenCL.so.1

#13 0x00000000004024fe in main ()

The process uses 100% of one CPU core in this state and does not seem to advance (killed after 30 minutes spent inside FileUtils::GetParametersFromFile). Strange thing is that it works even with CodeXL remote agent if launched with shorter commandline (less arguments). It gets stuck even with only 10 arguments, each only tens of characters long.

We use Ubuntu linux 12.04, both on servers and development clients. Clients run CodeXL GUI (version 1.2.3487.0) and servers run CodeXLRemoteAgent (same version 1.3.3487.0). Driver version is following:

[    6.750882] <6>[fglrx] module loaded - fglrx 13.35.5 [Mar 12 2014] with 1 minors

Any ideas please? Does CodeXL use any limit for command-line size? Is this limit documented if it exists? CodeXL does not seem to complain about command line arguments length - the profiled application just gets stuck.

Thanks,

Martin Jirman

0 Likes
4 Replies
amitbm
Staff

Hi Martin,

Will it be possible for you to share the profiled application?

Thanks.

0 Likes

Hi,

can't share our application, but the problem occurs with any OpenCL application with long command line when profiled in "GPU Application Trace" mode. For example, the same problem occurs with this simple OpenCL application: http://phycomp.technion.ac.il/~comphy/classfiles/hellocl.c if following text is used as "Command Line Arguments":

Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

It works, if I use less text as "Command Line Arguments". E.g. this does not cause the profiled application to freeze:

Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua.

Make sure to set low "trace data write interval" in "GPU Profile: Application Trace" tab in project settings, because the application just launches single simple kernel and quits immediately (or add one second sleep to the application end).

0 Likes

Hi Martin,

Thank you for your post. It seems like you discovered an issue with our GPU profiler.

Our team will address and fix that issue.

Thanks again.

Thanks. I hope that the solution won't be something like "arguments longer than 64 characters are forbidden" - because we'd like to profile our applications with full command line arguments support.

0 Likes