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

Compilation error on Windows #21

Closed
RaphaelRoyerRivard opened this issue Jul 24, 2019 · 8 comments
Closed

Compilation error on Windows #21

RaphaelRoyerRivard opened this issue Jul 24, 2019 · 8 comments

Comments

@RaphaelRoyerRivard
Copy link

RaphaelRoyerRivard commented Jul 24, 2019

Hello, I'm trying to install this python library on Windows (I know, support is not guaranteed). I'm having a problem related to CUDA, here is the error message:

1 error detected in the compilation of "C:/Users/root/AppData/Local/Temp/tmpxft_0000a540_00000000-10_correlation_cuda_kernel.cpp1.ii".
correlation_cuda_kernel.cu
error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.0\\bin\\nvcc.exe' failed with exit status 1

I don't understand why it keeps trying to use CUDA 10.0. In my path environment variable, the CUDA 9.2 is listed before CUDA 10.0 and my pytorch has been installed with CUDA 9.0 (because it won't install for CUDA 9.2, I don't know if this may cause a problem). I've read in other discussions that the CUDA version must be compatible with the gcc version, but I don't know mine and I don't know how to find it.

What should I do?

@ClementPinard
Copy link
Owner

Well i don't have a clue on how to set environment variable on windows, but you probably have to specify the nvcc version to call.

You can e.g. see here to figure out how pytorch finds the cuda environment and how you can fix it for your problem. https://github.com/pytorch/pytorch/blob/master/torch/utils/cpp_extension.py#L25

Also some comments can help you here https://github.com/pytorch/pytorch/blob/master/torch/utils/cpp_extension.py#L599

@RaphaelRoyerRivard
Copy link
Author

Oh, I forgot there was a CUDA_PATH environment variable. I am now able to force the use of CUDA 9.2 instead of 10.0, but it still fails with the same error.

1 error detected in the compilation of "C:/Users/root/AppData/Local/Temp/tmpxft_0000b8e4_00000000-10_correlation_cuda_kernel.cpp1.ii".
    correlation_cuda_kernel.cu
    error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2\\bin\\nvcc.exe' failed with exit status 1

In the thread of issue #1 , it is said that there seems to be incompatibilities with certain gcc and CUDA versions. Maybe I don't even have gcc on my computer. After a quick search on google, gcc doesn't seem to be easily usable on Windows...

@ClementPinard
Copy link
Owner

Have you tried to compile the official example ?
If the problem still occurs there, you might have more help from people experienced with windows on pytorch :)
https://github.com/pytorch/extension-cpp

@RaphaelRoyerRivard
Copy link
Author

Oh, we need to install c++ Pytorch? I only have the python version of Pytorch currently installed.

I also installed gcc v8.2.0 through MinGW, but pip install spatial-correlation-sampler fails with the same error, not matter the version of CUDA it is using.

@RaphaelRoyerRivard
Copy link
Author

Ok so I installed the c++ version of Pytorch from the repo you linked and then tried again the installation of your package in pip and it failed with the same error. Then I tried to install the cuda version of Pytorch from the same repo and it failed with the same error I was having. So I'll ask help on that repo and come back with the solution. Thanks for your help :)

@ClementPinard
Copy link
Owner

It's not c++ Pytorch, it's just an example on how to build cpp/cuda extensions like this one with pytorch.
The extension of this repo is based on the official example, that why I suggested you try the "basis" first.

@RaphaelRoyerRivard
Copy link
Author

I seem to have the same error as this guy pytorch/extension-cpp#37 and the issue is a month old with no answer... This doesn't look good at all :S

@RaphaelRoyerRivard RaphaelRoyerRivard changed the title How to specify cuda version Compilation error on Windows Jul 24, 2019
@RaphaelRoyerRivard
Copy link
Author

Someone answered with a working solution :D

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

2 participants