Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
992 Views

findPlatform() Call Changes Directories

I have a Cyclone V Development Kit. I have compiled my host code to a shared library (.so) and I am using this to make opencl calls from python using ctypes.cdll.  

 

Let's say I am running my program from `/home/root` on the board, as soon as I enter the `findPlatform()` call, my program switches directories to `/usr/bin` which is causing quite the headache. I've gone into the function in `opencl.cpp` and the directory is already `/usr/bin` as soon as I am in the function, so it looks like something to do with `findPlatform()` call from my host code. 

 

Any ideas? I have no idea what is going on.
0 Kudos
3 Replies
Altera_Forum
Honored Contributor I
73 Views

I'm not sure if this is your issue, but if you're looking at the Altera OpenCL examples in their host code. Within the init_opencl() there is  

 

if(!setCwdToExeDir()) { 

return false; 

 

statement which changes your working directory during runtime. 

 

I'm not entirely sure of its purpose but if you comment that out, it should work fine I'd imagine.
Altera_Forum
Honored Contributor I
73 Views

That does seem to work, not sure how I missed that one! Thank you. 

 

I don't quite understand the purpose of this either, hopefully there are no repercussions.
Altera_Forum
Honored Contributor I
73 Views

Yep, no problem. I've ran into that issue too and so far I haven't had any issues come up after removing it.

Reply