Altera OpenCL `findPlatform()` 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.