apex icon indicating copy to clipboard operation
apex copied to clipboard

TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Open KrisWongz opened this issue 5 years ago • 14 comments

Warning: Torch did not find available GPUs on this system. If your intention is to cross-compile, this is not an error. By default, Apex will cross-compile for Pascal (compute capabilities 6.0, 6.1, 6.2), Volta (compute capability 7.0), Turing (compute capability 7.5), and, if the CUDA version is >= 11.0, Ampere (compute capability 8.0). If you wish to cross-compile for a single specific architecture, export TORCH_CUDA_ARCH_LIST="compute capability" before running setup.py.

Traceback (most recent call last): File "setup.py", line 35, in _, bare_metal_major, _ = get_cuda_bare_metal_version(cpp_extension.CUDA_HOME) File "setup.py", line 14, in get_cuda_bare_metal_version raw_output = subprocess.check_output([cuda_dir + "/bin/nvcc", "-V"], universal_newlines=True) TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

KrisWongz avatar Nov 09 '20 13:11 KrisWongz

I have the same questions.Now do you find the solution?

6cigarette avatar Oct 06 '21 03:10 6cigarette

This occurs when you try to install apex on a non-GPU machine.

Run the following command would work like a charm:

cd apex
export TORCH_CUDA_ARCH_LIST="compute capability" 
python3 setup.py install

Symbolk avatar Mar 22 '22 13:03 Symbolk

Hello, did you solve this problem? I tried export TORCH_CUDA_ARCH_LIST="compute capability" but it can't work either.

BUAADreamer avatar Nov 08 '22 07:11 BUAADreamer

Hello, did you solve this problem? I tried export TORCH_CUDA_ARCH_LIST="compute capability" but it can't work either.

Hi, I also met the problem, did you find the solution? thanks

tzcskys avatar Nov 15 '22 09:11 tzcskys

Hello, did you solve this problem? I tried export TORCH_CUDA_ARCH_LIST="compute capability" but it can't work either.

Hi, I also met the problem, did you find the solution? thanks

Hi, I found out the problem with my environment is that the cuda installed with conda is not the full version, which means the nvcc is not installed. So use "conda install -c nvidia cuda-nvcc" first and try again, works for me. Put my solution here in case someone meet the same problem.

tzcskys avatar Nov 15 '22 10:11 tzcskys

Hello, did you solve this problem? I tried export TORCH_CUDA_ARCH_LIST="compute capability" but it can't work either.

Hi, I also met the problem, did you find the solution? thanks

Hi, I found out the problem with my environment is that the cuda installed with conda is not the full version, which means the nvcc is not installed. So use "conda install -c nvidia cuda-nvcc" first and try again, works for me. Put my solution here in case someone meet the same problem.

Yeah, I find the reason is I didn't install the whole package, I finally use conda env and pip3 install from source

BUAADreamer avatar Nov 15 '22 10:11 BUAADreamer

Hello, did you solve this problem? I tried export TORCH_CUDA_ARCH_LIST="compute capability" but it can't work either.

Hi, I also met the problem, did you find the solution? thanks

Hi, I found out the problem with my environment is that the cuda installed with conda is not the full version, which means the nvcc is not installed. So use "conda install -c nvidia cuda-nvcc" first and try again, works for me. Put my solution here in case someone meet the same problem.

Yeah, I find the reason is I didn't install the whole package, I finally use conda env and pip3 install from source

Hello, did you solve this problem? I tried export TORCH_CUDA_ARCH_LIST="compute capability" but it can't work either.

Hi, I also met the problem, did you find the solution? thanks

Hi, I found out the problem with my environment is that the cuda installed with conda is not the full version, which means the nvcc is not installed. So use "conda install -c nvidia cuda-nvcc" first and try again, works for me. Put my solution here in case someone meet the same problem.

you saved me!

xywhat avatar Nov 22 '22 06:11 xywhat

Hello, did you solve this problem? I tried export TORCH_CUDA_ARCH_LIST="compute capability" but it can't work either.

Hi, I also met the problem, did you find the solution? thanks

Hi, I found out the problem with my environment is that the cuda installed with conda is not the full version, which means the nvcc is not installed. So use "conda install -c nvidia cuda-nvcc" first and try again, works for me. Put my solution here in case someone meet the same problem.

Thanks, I encountered the same problem, and successfully solved it with your method

Fanstering avatar Nov 29 '22 08:11 Fanstering

Hello, did you solve this problem? I tried export TORCH_CUDA_ARCH_LIST="compute capability" but it can't work either.

Hi, I also met the problem, did you find the solution? thanks

Hi, I found out the problem with my environment is that the cuda installed with conda is not the full version, which means the nvcc is not installed. So use "conda install -c nvidia cuda-nvcc" first and try again, works for me. Put my solution here in case someone meet the same problem.

Thank you so much! This appears to work for me.

olayinkaajayi avatar May 26 '23 20:05 olayinkaajayi

python could nt find nvcc. Could need:

PATH=/usr/local/cuda/bin/:$PATH pip ...

WilliamTambellini avatar Jul 03 '23 22:07 WilliamTambellini

Got it sorted after trying out different things and digging into the web for answers. Ended up fixing it by installing the whole CUDA toolkit manually from this link. Figured I'd drop it here in case anyone else is pulling their hair out over the same issue. Cheers!

MSaqibShah avatar Dec 20 '23 20:12 MSaqibShah

For some reason the CUDA_HOME is none check is not working leading to this misleading error statement. It was happening because CUDA_HOME was not found in setup.py i.e from torch.utils.cpp_extension import CUDA_HOME was None To solve it, I installed CUDA from here https://developer.nvidia.com/cuda-downloads Then tried the apex installation command in a new shell

gndps avatar Apr 04 '24 02:04 gndps

Hello, did you solve this problem? I tried export TORCH_CUDA_ARCH_LIST="compute capability" but it can't work either.

Hi, I also met the problem, did you find the solution? thanks

Hi, I found out the problem with my environment is that the cuda installed with conda is not the full version, which means the nvcc is not installed. So use "conda install -c nvidia cuda-nvcc" first and try again, works for me. Put my solution here in case someone meet the same problem.

Hi, How can I specify version of nvcc installed with this command?

PussyCat0700 avatar May 15 '24 07:05 PussyCat0700