refixed cuda files so they respect LD_LIBRARY_PATHS etc