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

error: cannot open source file "/usr/local/cuda/include/math_functions.h" #77

Open
in3omnia opened this issue Mar 26, 2019 · 8 comments

Comments

@in3omnia
Copy link

Traceback (most recent call last):
  File "demo.py", line 47, in <module>
    no_post=args.no_post
  File "/home/lyh/FastPhotoStyle/process_stylization.py", line 135, in stylization
    out_img = smooth_filter(out_img, cont_pilimg, f_radius=15, f_edge=1e-1)
  File "/home/lyh/FastPhotoStyle/smooth_filter.py", line 402, in smooth_filter
    best_ = smooth_local_affine(output_, input_, 1e-7, 3, H, W, f_radius, f_edge)
  File "/home/lyh/FastPhotoStyle/smooth_filter.py", line 336, in smooth_local_affine
    ptx = program.compile(['-I/usr/local/cuda/include'])
  File "/home/lyh/.scidev_2018_11_03/.local/lib/python3.6/site-packages/pynvrtc/compiler.py", line 69, in compile
    raise ProgramException(log)
pynvrtc.compiler.ProgramException: best_local_affine_kernel.cu(2): catastrophic error: cannot open source file "/usr/local/cuda/include/math_functions.h"

1 catastrophic error detected in the compilation of "best_local_affine_kernel.cu".
Compilation terminated

my cuda path has changed, but in line 336, in smooth_local_affine ptx = program.compile(['-I/usr/local/cuda/include']) it doesn't read the CUDA_PATH variable.

@YanLiang0813
Copy link

I meet this problem too, could you tell me how to address the problem if you know the answer? thanks!

@in3omnia
Copy link
Author

I meet this problem too, could you tell me how to address the problem if you know the answer? thanks!

just change the location to your cuda/include path in line 336

@Seanseattle
Copy link

I had changed the code in line 336,like this:
ptx = program.compile(['-I/usr/local/cuda-env/cuda-9.1/include'])
I also set the CUDA_PATH and C_INCLUDE_PATH in .bashrc. However, it still occurs error
pynvrtc.compiler.ProgramException: best_local_affine_kernel.cu(2): catastrophic error: cannot open source file "/usr/local/cuda/include/math_functions.h. I don't know why use this path.
Could you tell me how to fix it. thx.
@in3omnia

@in3omnia
Copy link
Author

I had changed the code in line 336,like this:
ptx = program.compile(['-I/usr/local/cuda-env/cuda-9.1/include'])
I also set the CUDA_PATH and C_INCLUDE_PATH in .bashrc. However, it still occurs error
pynvrtc.compiler.ProgramException: best_local_affine_kernel.cu(2): catastrophic error: cannot open source file "/usr/local/cuda/include/math_functions.h. I don't know why use this path.
Could you tell me how to fix it. thx.
@in3omnia

Maybe you also need to change line 6 #include "/usr/local/cuda/include/math_functions.h" to your path.

@NicholasMcCarthy
Copy link

Any suggestions on getting this to work with a conda install of cuda?

@DaddyWesker
Copy link

Same question as Nicholas. How to make it work using anaconda's cuda?

@dhanpalrajpurohit
Copy link

First of all find math_funtions.h file in your system.
and perform some change in smooth_filter.py at line number 6.
#include "New Path"

example :
before #include "/usr/local/cuda/include/math_functions.h"
after #include "/usr/include/math_functions.h"
and run again

@lmy931
Copy link

lmy931 commented Feb 20, 2021

Any suggestions on getting this to work with a conda install of cuda?

Same Problem. Have you got a solution?

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

7 participants