ScaledYOLOv4 icon indicating copy to clipboard operation
ScaledYOLOv4 copied to clipboard

Can't use mish-cuda in cuda 11.1

Open yunxi1 opened this issue 4 years ago • 16 comments

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

yunxi1 avatar Jan 06 '21 10:01 yunxi1

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

WongKinYiu avatar Jan 06 '21 11:01 WongKinYiu

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 avatar Jan 06 '21 11:01 yunxi1

I will try mish_cuda in cuda11.0 again

yunxi1 avatar Jan 06 '21 11:01 yunxi1

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

yunxi1 avatar Jan 06 '21 14:01 yunxi1

what is the command you used to build mish_cuda?

WongKinYiu avatar Jan 06 '21 22:01 WongKinYiu

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

yunxi1 avatar Jan 07 '21 07:01 yunxi1

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

WongKinYiu avatar Jan 07 '21 07:01 WongKinYiu

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

yunxi1 avatar Jan 07 '21 08:01 yunxi1

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~

hoangduyloc avatar Jan 30 '21 15:01 hoangduyloc

@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!

yunxi1 avatar Feb 01 '21 01:02 yunxi1

@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!

hoangduyloc avatar Feb 01 '21 03:02 hoangduyloc

@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?

williamhyin avatar Apr 04 '21 01:04 williamhyin

@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.

hoangduyloc avatar Apr 05 '21 00:04 hoangduyloc

@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

williamhyin avatar Apr 05 '21 11:04 williamhyin

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

jishenghuang avatar Apr 01 '23 12:04 jishenghuang

Just use yolov7/8 ?


From: hoangduyloc @.> Sent: 30 January 2021 3:58 PM To: WongKinYiu/ScaledYOLOv4 @.> Cc: Subscribed @.***> Subject: Re: [WongKinYiu/ScaledYOLOv4] Can't use mish-cuda in cuda 11.1 (#119)

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

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~

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/WongKinYiu/ScaledYOLOv4/issues/119#issuecomment-770233154, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKPUVMSUZYGEDOH6BFPNOETS4QUCBANCNFSM4VXKHYLA.

LukeAI avatar Apr 01 '23 13:04 LukeAI