Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16939 Discussions

findPlatform() Call Changes Directories

Altera_Forum
Honored Contributor II
1,613 Views

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 II
694 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.
0 Kudos
Altera_Forum
Honored Contributor II
694 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.
0 Kudos
Altera_Forum
Honored Contributor II
694 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.

0 Kudos
Reply