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

NVIDIA 4060ti: ValueError: Unknown CUDA arch (8.9) or GPU not supported #143

Open
kangchouapp opened this issue Jan 21, 2025 · 3 comments
Open

Comments

@kangchouapp
Copy link

(pytorch17) root@ubuntu-Z790:/data/CenterFusion/src/lib/model/networks/DCNv2# conda env config vars set TORCH_CUDA_ARCH_LIST="8.0"
To make your changes take effect please reactivate your environment
(pytorch17) root@ubuntu-Z790:/data/CenterFusion/src/lib/model/networks/DCNv2# rm -rf build/
(pytorch17) root@ubuntu-Z790:/data/CenterFusion/src/lib/model/networks/DCNv2# rm -rf build/^C
(pytorch17) root@ubuntu-Z790:/data/CenterFusion/src/lib/model/networks/DCNv2# ^C
(pytorch17) root@ubuntu-Z790:/data/CenterFusion/src/lib/model/networks/DCNv2# python setup.py build develop
running build
running build_ext
/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/utils/cpp_extension.py:352: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
  warnings.warn(msg.format('we could not find ninja.'))
building '_ext' extension
creating build
creating build/temp.linux-x86_64-cpython-37
creating build/temp.linux-x86_64-cpython-37/data
creating build/temp.linux-x86_64-cpython-37/data/CenterFusion
creating build/temp.linux-x86_64-cpython-37/data/CenterFusion/src
creating build/temp.linux-x86_64-cpython-37/data/CenterFusion/src/lib
creating build/temp.linux-x86_64-cpython-37/data/CenterFusion/src/lib/model
creating build/temp.linux-x86_64-cpython-37/data/CenterFusion/src/lib/model/networks
creating build/temp.linux-x86_64-cpython-37/data/CenterFusion/src/lib/model/networks/DCNv2
creating build/temp.linux-x86_64-cpython-37/data/CenterFusion/src/lib/model/networks/DCNv2/src
creating build/temp.linux-x86_64-cpython-37/data/CenterFusion/src/lib/model/networks/DCNv2/src/cpu
creating build/temp.linux-x86_64-cpython-37/data/CenterFusion/src/lib/model/networks/DCNv2/src/cuda
g++ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/data/CenterFusion/src/lib/model/networks/DCNv2/src -I/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/include -I/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/include/TH -I/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda-11.0/include -I/opt/conda/envs/pytorch17/include/python3.7m -c /data/CenterFusion/src/lib/model/networks/DCNv2/src/cpu/dcn_v2_cpu.cpp -o build/temp.linux-x86_64-cpython-37/data/CenterFusion/src/lib/model/networks/DCNv2/src/cpu/dcn_v2_cpu.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
g++ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/data/CenterFusion/src/lib/model/networks/DCNv2/src -I/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/include -I/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/include/TH -I/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda-11.0/include -I/opt/conda/envs/pytorch17/include/python3.7m -c /data/CenterFusion/src/lib/model/networks/DCNv2/src/cpu/dcn_v2_im2col_cpu.cpp -o build/temp.linux-x86_64-cpython-37/data/CenterFusion/src/lib/model/networks/DCNv2/src/cpu/dcn_v2_im2col_cpu.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
g++ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/data/CenterFusion/src/lib/model/networks/DCNv2/src -I/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/include -I/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/include/TH -I/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda-11.0/include -I/opt/conda/envs/pytorch17/include/python3.7m -c /data/CenterFusion/src/lib/model/networks/DCNv2/src/cpu/dcn_v2_psroi_pooling_cpu.cpp -o build/temp.linux-x86_64-cpython-37/data/CenterFusion/src/lib/model/networks/DCNv2/src/cpu/dcn_v2_psroi_pooling_cpu.o -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
Traceback (most recent call last):
  File "setup.py", line 72, in <module>
    cmdclass={"build_ext": torch.utils.cpp_extension.BuildExtension},
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/dist.py", line 1208, in run_command
    super().run_command(command)
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/_distutils/command/build.py", line 132, in run
    self.run_command(cmd_name)
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/dist.py", line 1208, in run_command
    super().run_command(command)
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 84, in run
    _build_ext.run(self)
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
    self.build_extensions()
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 670, in build_extensions
    build_ext.build_extensions(self)
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/_distutils/command/build_ext.py", line 468, in build_extensions
    self._build_extensions_serial()
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/_distutils/command/build_ext.py", line 494, in _build_extensions_serial
    self.build_extension(ext)
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 246, in build_extension
    _build_ext.build_extension(self, ext)
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/Cython/Distutils/build_ext.py", line 135, in build_extension
    super(build_ext, self).build_extension(ext)
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/_distutils/command/build_ext.py", line 556, in build_extension
    depends=ext.depends,
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/setuptools/_distutils/ccompiler.py", line 599, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 418, in unix_wrap_single_compile
    cflags = unix_cuda_flags(cflags)
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 395, in unix_cuda_flags
    cflags + _get_cuda_arch_flags(cflags) +
  File "/opt/conda/envs/pytorch17/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1438, in _get_cuda_arch_flags
    raise ValueError("Unknown CUDA arch ({}) or GPU not supported".format(arch))
ValueError: Unknown CUDA arch (8.9) or GPU not supported


@kangchouapp
Copy link
Author

I have successfully solved this problem. The following is a screenshot:

Image

@dagezhuang
Copy link

I have the same issue, can you share the details of the solution? Thanks

@kangchouapp
Copy link
Author

I have the same issue, can you share the details of the solution? Thanks

I have successfully resolved this bug on 4060TI. The screenshot is as follows, and my email is: [email protected]

Image

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