Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime compilation doesn't respect environment variables for include paths #141

Open
lakinwecker opened this issue Nov 7, 2018 · 5 comments

Comments

@lakinwecker
Copy link

lakinwecker commented Nov 7, 2018

The image warping example builds just fine, but it won't run. It has this error:
I updated ../shared/make_template.inc to point to my install of CUDA and I updated LD_LIBRARY_PATH, and C_INCLUDE_PATH and CPLUS_INCLUDE_PATH to point to the CUDA includes and library directories respectively, but the example doesn't run:

~➜ ./image_warping 
width 512, height 512
numActivePixels: 101406
<buffer>:5:10: fatal error: 'cuda_runtime.h' file not found
#include <cuda_runtime.h>
         ^
compilation of included c code failed

It's probably not running clang with any of the environment variables I have set, and it's also not respecting the makefile.inc settings. How do I tell it where to find cuda during runtime?

@lhoangan
Copy link

lhoangan commented Dec 8, 2018

Hi @lakinwecker have you found a way to overcome this problem? I've got exact the same problem as the installed path of cuda is not standard. I've tried to change all <cuda_runtime.h> to "cuda_runtime.h" but still no luck.

@lakinwecker
Copy link
Author

@lhoangan No. I never did successfully work around it. I gave up trying to use Opt some time ago. It depends on too many things that are too old and I didn't feel like manually compiling old compilers to get it working.

@mfratarcangeli
Copy link

The issue happens when the installed version of cuda is different than 7.5. Opt.lib seems to have hard-coded the path to cuda 7.5, however, and this is not configurable hence the error.

I found a workaround by making a hard symlink to the installed version of cuda, i.e. run "cmd" with admin provileges and then write:
mklink /J "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1"

(note change 10.1 to the version that you have currently installed; also the second path may slightly change on your system, so double-check it)

@lhoangan
Copy link

lhoangan commented Sep 5, 2019

For future reference, update $CUDA_HOME (for Linux) and $CUDA_PATH (for Windows) works for me

@lakinwecker
Copy link
Author

Good to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants