Open wangye8899 opened 5 years ago
i also met the same error, have you solve it
hi can you share the stack trace with the error messages?
also, the new version >= 2.1.8 requires ninja
to compile the CUDA code. please make sure you have it installed.
C:\ProgramData\Anaconda3\python.exe C:/孙鹏飞/sru/sru-master/sru-master/DYNAMIC/main2.py
C:\ProgramData\Anaconda3\lib\site-packages\torch\nn_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='mean' instead.
warnings.warn(warning.format(ret))
C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\cpp_extension.py:189: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。
warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
��Ϣ: ���ṩ��ģʽ���ҵ��ļ���
Traceback (most recent call last):
File "C:\孙鹏飞\sru\sru-master\sru-master\DYNAMIC\sru\sru_functional.py", line 35, in _lazy_load_cuda_kernel
from .cuda_functional import SRU_Compute_GPU
File "C:\孙鹏飞\sru\sru-master\sru-master\DYNAMIC\sru\cuda_functional.py", line 14, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/孙鹏飞/sru/sru-master/sru-master/DYNAMIC/main2.py", line 121, in
Same here, win10
Got the same error trying to execute example from Examples section. It raises only on latest version (2.1.9)
Hi, guys~ I solved this problem. That's a odd phenomenon in windows. The SRU is compiled when it is executed first time, so we need to set the MSVC in windows.
My environment cuda 10.1 python 3.6.8 pytorch 1.3.1 sru 2.1.9 ninja 1.9.0
First. install MSVC 2017 (include VC++ 2017 version 15.9 v14.16 latest v141 tools and Windows 10 SDK), then execute the script "VS 2017 x64 Native Tools" and run your model code. The SRU is generated into several files below the folder ("C:\Users{your name}\AppData\Local\Temp\torch_extensions\sru_cuda_impl").
Well same on linux https://colab.research.google.com/drive/1Sk-XoxRcym9izg9wsnmKnAFL1CWXkzVL
Well same on linux https://colab.research.google.com/drive/1Sk-XoxRcym9izg9wsnmKnAFL1CWXkzVL
Maybe check compiler setting?
apt-get install build-essential
?
there is no any problem on my linux server (ubuntu and MacOS).
I have run it again with same notebook and now it runs without problems. Strange.
@fann1993814 I tring to run on amazon linux, but kernel crush without warnings, any ideas?
Hi, guys~ I solved this problem. That's a odd phenomenon in windows. The SRU is compiled when it is executed first time, so we need to set the MSVC in windows.
My environment cuda 10.1 python 3.6.8 pytorch 1.3.1 sru 2.1.9 ninja 1.9.0
First. install MSVC 2017 (include VC++ 2017 version 15.9 v14.16 latest v141 tools and Windows 10 SDK), then execute the script "VS 2017 x64 Native Tools" and run your model code. The SRU is generated into several files below the folder ("C:\Users{your name}\AppData\Local\Temp\torch_extensions\sru_cuda_impl").
C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\cpp_extension.py:189: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。
Emitting ninja build file C:\Users\飞\AppData\Local\Temp\torch_extensions\sru_cuda_impl\build.ninja...
warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
��Ϣ: ���ṩ��ģʽ���ҵ��ļ���
Using C:\Users\飞\AppData\Local\Temp\torch_extensions as PyTorch extensions root...
No modifications detected for re-loaded extension module sru_cuda_impl, skipping build step...
Loading extension module sru_cuda_impl...
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\sru\sru_functional.py", line 35, in _lazy_load_cuda_kernel
from .cuda_functional import SRU_Compute_GPU
File "C:\ProgramData\Anaconda3\lib\site-packages\sru\cuda_functional.py", line 15, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:/sru-master/sru-master/misc/compare_gpu_speed_sru_gru.py.py", line 83, in
hi, the problem issolved? could tell me how to solve it on Win10
@taolei87 @taoleicn @hpasapp Any ideas? I think the bug affects all the operating systems.
Download this file (MSVC Build Tool for 2017, Don't use 2019, it will failed) https://aka.ms/vs/15/release/vs_buildtools.exe
And Install items (like this, sorry my language is Chinese)
Finally, add (C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64) into your OS Environment Variable PATH
Follow steps
It won't compile again, so the second time execution is very fast.
My Env: Windows 10 CUDA 10.1 Pytorch 1.3 Python 3.6.8
same problem on Linux, how to solve it?
@snsxf on linux, check you have the version of cupy corresponding to your cuda toolkit installed. eg if you have CUDA toolkit 10.1, check you have installed cupy-cuda101
.
@fann1993814 I have feeling it compile every time on windows. It work only from VS 2017 x64 Native Tools and every time i run it it write
E:\neuro_projects\Anaconda3\lib\site-packages\torch\utils\cpp_extension.py:209: UserWarning: Error checking compiler version for cl: 'utf-8' codec can't decode byte 0x8e in position 0: invalid start byte warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
Download this file (MSVC Build Tool for 2017, Don't use 2019, it will failed) https://aka.ms/vs/15/release/vs_buildtools.exe
And Install items (like this, sorry my language is Chinese)
Finally, add (C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64) into your OS Environment Variable PATH
Follow steps
- Execute the script "VS 2017 x64 Native Tools"
- Run example code (or your code) in the Command Prompt (python xxx.py)
- Waiting for compiling (Please confirm your memory is higher than 4G)
It won't compile again, so the second time execution is very fast.
My Env: Windows 10 CUDA 10.1 Pytorch 1.3 Python 3.6.8
Thx, this works. But the code must be implemented from x64 native tools command prompt. If I run it in Windows shell or directly from VS code, the error "ModuleNotFoundError: No module named 'cuda_functional'" is still shown.
@hpasapp The version got from nvcc --version
differs from nvidia-smi
. However, I have tried to install cupy for both the versions in separate conda environments, but I still get the error ModuleNotFoundError: No module named 'cuda_functional'
. In both cases.
Also I have followed the comment here by @taolei87 . With no luck.
My Env: Ubuntu 18.04 CUDA 10.2 Pytorch 1.4 Python 3.7
I would say that having.a different CUDA version reported by nvidia-smi compared to the version reported by nvcc --version sounds odd to me. I think you should try to figure out why they are different, and ensure they are the same (they are the same on my system: both 10.1).
@hpasapp That's perfectly right! I purged the Nvidia driver and Cuda toolkit, and installed them again. It works like charm. Thank you.
Great!
On Fri, Apr 3, 2020 at 8:33 AM dataprowl notifications@github.com wrote:
@hpasapp https://github.com/hpasapp That's perfectly right! I purged the Nvidia driver and Cuda toolkit, and installed them again. It works like charm. Thank you.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asappresearch/sru/issues/109#issuecomment-608408126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZ5OBGY3I7OI5LJDXPVFGLRKXJS3ANCNFSM4JKADMMA .
-- HUGH PERKINS Research Engineer
https://www.asapp.com/ One World Trade Center 80th Floor New York, NY 10007
@hadaev8
I have feeling it compile every time on windows. It work only from VS 2017 x64 Native Tools and every time i run it it write
E:\neuro_projects\Anaconda3\lib\site-packages\torch\utils\cpp_extension.py:209: UserWarning: Error checking compiler version for cl: 'utf-8' codec can't decode byte 0x8e in position 0: invalid start byte warnings.warn('Error checking compiler version for {}: {}'.format(compiler, error))
I've had same problem but found a dirty fix: 1) Clean build folder (c:\Users\username\AppData\Local\Temp\torch_extensions\sru_cuda_impl) 2) Run SRU example NOT from VS 2017 x64 Native Tools 3) In VS Tools switch working directory to build folder and run "ninja -v"
Not sure why it helped, maybe because VS Tools use its own ninja version in "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
Once I fiddled with the code of _lazy_load_cuda_kernel
, so it looks like this:
# load C++ implementation for GPU computation
def _lazy_load_cuda_kernel():
# try:
from sru.cuda_functional import SRU_Compute_GPU
# except:
# from cuda_functional import SRU_Compute_GPU
return SRU_Compute_GPU
, I got a way more meaningful message from ninja, stating it does not support version of GCC installed on my machine:
Just to comment about it, I had the same error, but it was masked because of the try catch. In my case, I was missing the nvcc . Changing the docker image to nvidia/cuda:10.2-cudnn7-devel solved it
同样遇到这个问题,自己的解决过程如下:https://blog.csdn.net/qq_32239767/article/details/109626626
hi, i met the same error, have you solve it