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

Can't use mish-cuda in cuda 11.1 #119

Open
yunxi1 opened this issue Jan 6, 2021 · 16 comments
Open

Can't use mish-cuda in cuda 11.1 #119

yunxi1 opened this issue Jan 6, 2021 · 16 comments

Comments

@yunxi1
Copy link

yunxi1 commented Jan 6, 2021

Hi, My GPU is RTX3090, it's cuda version is 11.1,so I can't install mish-cuda,is there another way to install mish-cuda?
or use pytorch mish function:

class Mish(nn.Module):
def init(self):
super().init()
print("Mish activation loaded...")
def forward(self,x):
x = x * (torch.tanh(F.softplus(x)))
return x
but I don't know whether speed would be slower than mish-cuda in inference stage?such as FPS

@WongKinYiu
Copy link
Owner

i am not sure about cuda 11.1, but i can build mish_cuda with cuda 11.0.

@yunxi1
Copy link
Author

yunxi1 commented Jan 6, 2021

I have tried ways: https://github.com/thomasbrandon/mish-cuda and https://github.com/JunnYu/mish-cuda
they all failed
and I change my mind to use mish function in your code:
class Mish(nn.Module): # https://github.com/digantamisra98/Mish
def forward(self, x):
return x * torch.nn.functional.softplus(x).tanh()
but when I load your pretrain model,there is a error:

File "train.py", line 122, in train
ckpt = torch.load(weights, map_location=device) # load checkpoint
File "/home/shen/software/anaconda3/envs/nvidia-tensorflow-onnx/lib/python3.6/site-packages/torch/serialization.py", line 595, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/home/shen/software/anaconda3/envs/nvidia-tensorflow-onnx/lib/python3.6/site-packages/torch/serialization.py", line 774, in _legacy_load
result = unpickler.load()
ModuleNotFoundError: No module named 'mish_cuda'
how to solve it if I use your model as pretrain model?

@yunxi1
Copy link
Author

yunxi1 commented Jan 6, 2021

I will try mish_cuda in cuda11.0 again

@yunxi1
Copy link
Author

yunxi1 commented Jan 6, 2021

cuda11.0 failed too
this is error ,have you ever encountered this problem?
My environment variable is right.

:/usr/local/cuda/bin/nvcc -Iexternal -I/home/shen/software/anaconda3/envs/nvidia-tensorflow-onnx/lib/python3.6/site-packages/torch/include -I/home/shen/software/anaconda3/envs/nvidia-tensorflow-onnx/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/shen/software/anaconda3/envs/nvidia-tensorflow-onnx/lib/python3.6/site-packages/torch/include/TH -I/home/shen/software/anaconda3/envs/nvidia-tensorflow-onnx/lib/python3.6/site-packages/torch/include/THC -I:/usr/local/cuda/include -I/home/shen/software/anaconda3/envs/nvidia-tensorflow-onnx/include/python3.6m -c csrc/mish_kernel.cu -o build/temp.linux-x86_64-3.6/csrc/mish_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' --expt-extended-lambda -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=sm_86 -std=c++14
unable to execute ':/usr/local/cuda/bin/nvcc': No such file or directory
error: command ':/usr/local/cuda/bin/nvcc' failed with exit status 1

ERROR: Failed building wheel for mish-cuda

@WongKinYiu
Copy link
Owner

what is the command you used to build mish_cuda?

@yunxi1
Copy link
Author

yunxi1 commented Jan 7, 2021

command: python setup.py install
ways: https://github.com/thomasbrandon/mish-cuda or https://github.com/JunnYu/mish-cuda
new error:
nvcc fatal : Unsupported gpu architecture 'compute_86'
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1

@WongKinYiu
Copy link
Owner

WongKinYiu commented Jan 7, 2021

well, it seems compute_86 only supported by cuda>=11.1.

@yunxi1
Copy link
Author

yunxi1 commented Jan 7, 2021

yes, add environment variable:export TORCH_CUDA_ARCH_LIST="7.5" downgrade version
it works!

@hoangduyloc
Copy link

hoangduyloc commented Jan 30, 2021

yes, add environment variable:export TORCH_CUDA_ARCH_LIST="7.5" downgrade version
it works!

@yunxi1
Hi there, I stuck install mish-cuda in RTX3090 too
export TORCH_CUDA_ARCH_LIST="7.5" downgrade version I don't really get your mean
Can you please share with me the steps in details, My Cuda 11.0, RTX3090
Thank you~

@yunxi1
Copy link
Author

yunxi1 commented Feb 1, 2021

@hoangduyloc make sure that pytorch1.7+cuda11.0 installed correctly,then add environment variable:export TORCH_CUDA_ARCH_LIST="8.0" because pytorch cant't work in compute_86(3090),but it could work in compute_80,good luck!

@hoangduyloc
Copy link

@hoangduyloc make sure that pytorch1.7+cuda11.0 installed correctly,then add environment variable:export TORCH_CUDA_ARCH_LIST="8.0" because pytorch cant't work in compute_86(3090),but it could work in compute_80,good luck!
Thankyou for your response. I installed it successfully via Cuda 11.1; pytorch1.7.1+cuda11.0 and export TORCH_CUDA_ARCH_LIST="7.5". So anyone else stuck may have two solutions here!

@williamhyin
Copy link

@hoangduyloc make sure that pytorch1.7+cuda11.0 installed correctly,then add environment variable:export TORCH_CUDA_ARCH_LIST="8.0" because pytorch cant't work in compute_86(3090),but it could work in compute_80,good luck!
Thankyou for your response. I installed it successfully via Cuda 11.1; pytorch1.7.1+cuda11.0 and export TORCH_CUDA_ARCH_LIST="7.5". So anyone else stuck may have two solutions here!

Hi, I have tried your method, but it could not work.

unable to execute '/usr/local/cuda-11.0/bin/bin/nvcc': No such file or directory

Have you any idea about this issue?

@hoangduyloc
Copy link

@hoangduyloc make sure that pytorch1.7+cuda11.0 installed correctly,then add environment variable:export TORCH_CUDA_ARCH_LIST="8.0" because pytorch cant't work in compute_86(3090),but it could work in compute_80,good luck!
Thankyou for your response. I installed it successfully via Cuda 11.1; pytorch1.7.1+cuda11.0 and export TORCH_CUDA_ARCH_LIST="7.5". So anyone else stuck may have two solutions here!

Hi, I have tried your method, but it could not work.

unable to execute '/usr/local/cuda-11.0/bin/bin/nvcc': No such file or directory

Have you any idea about this issue?

Before I stuck like you also, make sure you delete everything before you install Cuda, PyTorch, mish-cuda
"unable to execute '/usr/local/cuda-11.0/bin/bin/nvcc': No such file or directory" seems like you're lacking cudnn?
Hope that you figure it out soon, and one notice, most of the training results from RTX3090 are always lower than old GPUs like 1080,2080... seems like the newest version is somehow incompatible with NvidiaDriver I think.

@williamhyin
Copy link

@hoangduyloc make sure that pytorch1.7+cuda11.0 installed correctly,then add environment variable:export TORCH_CUDA_ARCH_LIST="8.0" because pytorch cant't work in compute_86(3090),but it could work in compute_80,good luck!
Thankyou for your response. I installed it successfully via Cuda 11.1; pytorch1.7.1+cuda11.0 and export TORCH_CUDA_ARCH_LIST="7.5". So anyone else stuck may have two solutions here!

Hi, I have tried your method, but it could not work.

unable to execute '/usr/local/cuda-11.0/bin/bin/nvcc': No such file or directory

Have you any idea about this issue?

The issue was solved. I re-installed the cuda 11.0 and correspoding cudnn.
The solution: Cuda 11.0+Pytorch 1.70 +python 3.6 + export TORCH_CUDA_ARCH_LIST="8.0" + Nvidia 3090

@jishenghuang
Copy link

jishenghuang commented Apr 1, 2023

Install the program to the running build_ ext, this error occurred:[WinError 2] The system cannot find the specified file.
What should we do about it

@LukeAI
Copy link

LukeAI commented Apr 1, 2023 via email

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

6 participants