问题描述
from torch.utils.cpp_extension import load
wkv_cuda = load(name="wkv", sources=["./cuda/wkv_op.cpp", "./cuda/wkv_cuda.cu"],
verbose=True, extra_cuda_cflags=['-res-usage', '--maxrregcount 60', '--use_fast_math', '-O3', '-Xptxas -O3', f'-DTmax={T_MAX}'])
ninja 已经安装
通过conda install ninja
pycharm运行出现问题
raise RuntimeError("Ninja is required to load C++ extensions") RuntimeError: Ninja is required to load C++ extensions
shell 窗口执行正常
运行命令 python xxx.py
解决办法
1. sudo apt-get install ninja-build