Skip to content

RuntimeError: Error building extension 'wkv' #53

@MaoFuyou

Description

@MaoFuyou

(base) bnwu@chern:~/Dense-RWLV-UNet$ python main_train_RWKV.py
Using /home/ET/bnwu/.cache/torch_extensions/py310_cu118 as PyTorch extensions root...
Detected CUDA files, patching ldflags
Emitting ninja build file /home/ET/bnwu/.cache/torch_extensions/py310_cu118/wkv/build.ninja...
Building extension module wkv...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/2] /home/ET/bnwu/anaconda3/bin/nvcc -DTORCH_EXTENSION_NAME=wkv -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="gcc" -DPYBIND11_STDLIB="libstdcpp" -DPYBIND11_BUILD_ABI="cxxabi1011" -isystem /home/ET/bnwu/anaconda3/lib/python3.10/site-packages/torch/include -isystem /home/ET/bnwu/anaconda3/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -isystem /home/ET/bnwu/anaconda3/lib/python3.10/site-packages/torch/include/TH -isystem /home/ET/bnwu/anaconda3/lib/python3.10/site-packages/torch/include/THC -isystem /home/ET/bnwu/anaconda3/include -isystem /home/ET/bnwu/anaconda3/include/python3.10 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS_ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 --compiler-options '-fPIC' -res-usage --maxrregcount 60 --use_fast_math -O3 -Xptxas -O3 -DTmax=65536 -std=c++17 -c /home/ET/bnwu/Dense-RWLV-UNet/cuda/wkv_cuda.cu -o wkv_cuda.cuda.o
FAILED: wkv_cuda.cuda.o
/home/ET/bnwu/anaconda3/bin/nvcc -DTORCH_EXTENSION_NAME=wkv -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="gcc" -DPYBIND11_STDLIB="libstdcpp" -DPYBIND11_BUILD_ABI="cxxabi1011" -isystem /home/ET/bnwu/anaconda3/lib/python3.10/site-packages/torch/include -isystem /home/ET/bnwu/anaconda3/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -isystem /home/ET/bnwu/anaconda3/lib/python3.10/site-packages/torch/include/TH -isystem /home/ET/bnwu/anaconda3/lib/python3.10/site-packages/torch/include/THC -isystem /home/ET/bnwu/anaconda3/include -isystem /home/ET/bnwu/anaconda3/include/python3.10 -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS_ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 --compiler-options '-fPIC' -res-usage --maxrregcount 60 --use_fast_math -O3 -Xptxas -O3 -DTmax=65536 -std=c++17 -c /home/ET/bnwu/Dense-RWLV-UNet/cuda/wkv_cuda.cu -o wkv_cuda.cuda.o
nvcc fatal : Unsupported gpu architecture 'compute_89'
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/home/ET/bnwu/anaconda3/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1893, in _run_ninja_build
subprocess.run(
File "/home/ET/bnwu/anaconda3/lib/python3.10/subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/ET/bnwu/Dense-RWLV-UNet/main_train_RWKV.py", line 6, in
from rwkv_unet import *
File "/home/ET/bnwu/Dense-RWLV-UNet/rwkv_unet.py", line 31, in
wkv_cuda = load(name="wkv", sources=["cuda/wkv_op.cpp", "cuda/wkv_cuda.cu"],
File "/home/ET/bnwu/anaconda3/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1284, in load
return _jit_compile(
File "/home/ET/bnwu/anaconda3/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1509, in _jit_compile
_write_ninja_file_and_build_library(
File "/home/ET/bnwu/anaconda3/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1624, in _write_ninja_file_and_build_library
_run_ninja_build(
File "/home/ET/bnwu/anaconda3/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1909, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error building extension 'wkv'

python=3.10.0 cuda12.4 ,想问一下是怎么回事

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions