Closed linonetwo closed 1 year ago
Solved by install cuda 11.7.1 instead of 12
And reinstall torch
pip install --force-reinstall -v "torch==1.13.1" "torchaudio==0.13.1" "torchvision==0.14.1" --extra-index-url https://download.pytorch.org/whl/cu117
After upgrade to win11
PS E:\repo\ChatRWKV> pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117
Looking in indexes: https://mirrors.cloud.tencent.com/pypi/simple, https://download.pytorch.org/whl/cu117
ERROR: Could not find a version that satisfies the requirement torch==1.13.1+cu117 (from versions: 2.0.0, 2.0.0+cu117)
ERROR: No matching distribution found for torch==1.13.1+cu117
Always saying No matching distribution found for torch==1.13.1+cu117
And running chat.py says No CUDA runtime is found
PS E:\repo\ChatRWKV> python v2\chat.py
ChatRWKV v2 https://github.com/BlinkDL/ChatRWKV
English - cuda fp16i8 *20 -> cuda fp16 - E:\repo\ChatRWKV\v2/prompt/default/English-2.py
No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7'
Using C:\Users\linonetwo\AppData\Local\torch_extensions\torch_extensions\Cache\py311_cpu as PyTorch extensions root...
Detected CUDA files, patching ldflags
Emitting ninja build file C:\Users\linonetwo\AppData\Local\torch_extensions\torch_extensions\Cache\py311_cpu\wkv_cuda\build.ninja...
Traceback (most recent call last):
File "E:\repo\ChatRWKV\v2\chat.py", line 99, in <module>
from rwkv.model import RWKV
File "E:\repo\ChatRWKV\v2/../rwkv_pip_package/src\rwkv\model.py", line 29, in <module>
load(
File "C:\Users\linonetwo\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 1284, in load
return _jit_compile(
^^^^^^^^^^^^^
File "C:\Users\linonetwo\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 1509, in _jit_compile
_write_ninja_file_and_build_library(
File "C:\Users\linonetwo\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 1611, in _write_ninja_file_and_build_library
_write_ninja_file_to_build_library(
File "C:\Users\linonetwo\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 2007, in _write_ninja_file_to_build_library
cuda_flags = common_cflags + COMMON_NVCC_FLAGS + _get_cuda_arch_flags()
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\linonetwo\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 1773, in _get_cuda_arch_flags
arch_list[-1] += '+PTX'
~~~~~~~~~^^^^
IndexError: list index out of range
Try install python 3.10 instead of latest 3.11
https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/7166#issuecomment-1402265851
After upgrade to win11
PS E:\repo\ChatRWKV> pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117 Looking in indexes: https://mirrors.cloud.tencent.com/pypi/simple, https://download.pytorch.org/whl/cu117 ERROR: Could not find a version that satisfies the requirement torch==1.13.1+cu117 (from versions: 2.0.0, 2.0.0+cu117) ERROR: No matching distribution found for torch==1.13.1+cu117
Always saying
No matching distribution found for torch==1.13.1+cu117
And running chat.py says
No CUDA runtime is found
PS E:\repo\ChatRWKV> python v2\chat.py ChatRWKV v2 https://github.com/BlinkDL/ChatRWKV English - cuda fp16i8 *20 -> cuda fp16 - E:\repo\ChatRWKV\v2/prompt/default/English-2.py No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7' Using C:\Users\linonetwo\AppData\Local\torch_extensions\torch_extensions\Cache\py311_cpu as PyTorch extensions root... Detected CUDA files, patching ldflags Emitting ninja build file C:\Users\linonetwo\AppData\Local\torch_extensions\torch_extensions\Cache\py311_cpu\wkv_cuda\build.ninja... Traceback (most recent call last): File "E:\repo\ChatRWKV\v2\chat.py", line 99, in <module> from rwkv.model import RWKV File "E:\repo\ChatRWKV\v2/../rwkv_pip_package/src\rwkv\model.py", line 29, in <module> load( File "C:\Users\linonetwo\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 1284, in load return _jit_compile( ^^^^^^^^^^^^^ File "C:\Users\linonetwo\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 1509, in _jit_compile _write_ninja_file_and_build_library( File "C:\Users\linonetwo\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 1611, in _write_ninja_file_and_build_library _write_ninja_file_to_build_library( File "C:\Users\linonetwo\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 2007, in _write_ninja_file_to_build_library cuda_flags = common_cflags + COMMON_NVCC_FLAGS + _get_cuda_arch_flags() ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\linonetwo\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\utils\cpp_extension.py", line 1773, in _get_cuda_arch_flags arch_list[-1] += '+PTX' ~~~~~~~~~^^^^ IndexError: list index out of range
got the same issue with python 3.11
The error
should not happened, because
wkv_cuda.pyd
is thereThe error is caused by
This
LoadLibrary
is buggy in windows when loading pyd file.