Reinstall CUDA 11.7 (install VC++ extensions).
-- What is the purpose of re-installing if CUDA 11.7 is already installed?
Using C:\Users\Jason\AppData\Local\torch_extensions\torch_extensions\Cache\py310_cu116 as PyTorch extensions root...
C:\Users\Jason\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\cpp_extension.py:358: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified
warnings.warn(f'Error checking compiler version for {compiler}: {error}')
Detected CUDA files, patching ldflags
Emitting ninja build file C:\Users\Jason\AppData\Local\torch_extensions\torch_extensions\Cache\py310_cu116\wkv_cuda\build.ninja...
---------------------------------------------------------------------------
CalledProcessError Traceback (most recent call last)
Cell In [3], line 1
----> 1 from rwkv.model import RWKV
2 from rwkv.utils import PIPELINE, PIPELINE_ARGS
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\rwkv\model.py:29
27 if os.environ.get('RWKV_CUDA_ON') == '1':
28 from torch.utils.cpp_extension import load
---> 29 load(
30 name=f"wkv_cuda",
31 sources=[f"{current_path}/cuda/wrapper.cpp", f"{current_path}/cuda/operators.cu"],
32 verbose=True,
33 extra_cuda_cflags=["-t 4", "-std=c++17", "--use_fast_math", "-O3", "--extra-device-vectorization"],
34 is_python_module=False)
36 @MyStatic
37 def cuda_wkv(T: int, C: int, w, u, k, v, aa, bb, pp):
38 assert 1 * C % min(C, 32) == 0
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\cpp_extension.py:1284, in load(name, sources, extra_cflags, extra_cuda_cflags, extra_ldflags, extra_include_paths, build_directory, verbose, with_cuda, is_python_module, is_standalone, keep_intermediates)
1192 def load(name,
1193 sources: Union[str, List[str]],
1194 extra_cflags=None,
(...)
1202 is_standalone=False,
1203 keep_intermediates=True):
1204 r'''
1205 Loads a PyTorch C++ extension just-in-time (JIT).
1206
(...)
1282 ... verbose=True)
1283 '''
-> 1284 return _jit_compile(
1285 name,
1286 [sources] if isinstance(sources, str) else sources,
1287 extra_cflags,
1288 extra_cuda_cflags,
1289 extra_ldflags,
1290 extra_include_paths,
1291 build_directory or _get_build_directory(name, verbose),
1292 verbose,
1293 with_cuda,
1294 is_python_module,
1295 is_standalone,
1296 keep_intermediates=keep_intermediates)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\cpp_extension.py:1508, in _jit_compile(name, sources, extra_cflags, extra_cuda_cflags, extra_ldflags, extra_include_paths, build_directory, verbose, with_cuda, is_python_module, is_standalone, keep_intermediates)
1504 hipified_sources.add(hipify_result[s_abs]["hipified_path"] if s_abs in hipify_result else s_abs)
1506 sources = list(hipified_sources)
-> 1508 _write_ninja_file_and_build_library(
1509 name=name,
1510 sources=sources,
1511 extra_cflags=extra_cflags or [],
1512 extra_cuda_cflags=extra_cuda_cflags or [],
1513 extra_ldflags=extra_ldflags or [],
1514 extra_include_paths=extra_include_paths or [],
1515 build_directory=build_directory,
1516 verbose=verbose,
1517 with_cuda=with_cuda,
1518 is_standalone=is_standalone)
1519 finally:
1520 baton.release()
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\cpp_extension.py:1610, in _write_ninja_file_and_build_library(name, sources, extra_cflags, extra_cuda_cflags, extra_ldflags, extra_include_paths, build_directory, verbose, with_cuda, is_standalone)
1607 print(f'Emitting ninja build file {build_file_path}...', file=sys.stderr)
1608 # NOTE: Emitting a new ninja build file does not cause re-compilation if
1609 # the sources did not change, so it's ok to re-emit (and it's fast).
-> 1610 _write_ninja_file_to_build_library(
1611 path=build_file_path,
1612 name=name,
1613 sources=sources,
1614 extra_cflags=extra_cflags or [],
1615 extra_cuda_cflags=extra_cuda_cflags or [],
1616 extra_ldflags=extra_ldflags or [],
1617 extra_include_paths=extra_include_paths or [],
1618 with_cuda=with_cuda,
1619 is_standalone=is_standalone)
1621 if verbose:
1622 print(f'Building extension module {name}...', file=sys.stderr)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\cpp_extension.py:2055, in _write_ninja_file_to_build_library(path, name, sources, extra_cflags, extra_cuda_cflags, extra_ldflags, extra_include_paths, with_cuda, is_standalone)
2052 ext = EXEC_EXT if is_standalone else LIB_EXT
2053 library_target = f'{name}{ext}'
-> 2055 _write_ninja_file(
2056 path=path,
2057 cflags=cflags,
2058 post_cflags=None,
2059 cuda_cflags=cuda_flags,
2060 cuda_post_cflags=None,
2061 cuda_dlink_post_cflags=None,
2062 sources=sources,
2063 objects=objects,
2064 ldflags=ldflags,
2065 library_target=library_target,
2066 with_cuda=with_cuda)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\cpp_extension.py:2195, in _write_ninja_file(path, cflags, post_cflags, cuda_cflags, cuda_post_cflags, cuda_dlink_post_cflags, sources, objects, ldflags, library_target, with_cuda)
2193 link_rule = ['rule link']
2194 if IS_WINDOWS:
-> 2195 cl_paths = subprocess.check_output(['where',
2196 'cl']).decode(*SUBPROCESS_DECODE_ARGS).split('\r\n')
2197 if len(cl_paths) >= 1:
2198 cl_path = os.path.dirname(cl_paths[0]).replace(':', '$:')
File ~\AppData\Local\Programs\Python\Python310\lib\subprocess.py:421, in check_output(timeout, *popenargs, **kwargs)
418 empty = b''
419 kwargs['input'] = empty
--> 421 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
422 **kwargs).stdout
File ~\AppData\Local\Programs\Python\Python310\lib\subprocess.py:526, in run(input, capture_output, timeout, check, *popenargs, **kwargs)
524 retcode = process.poll()
525 if check and retcode:
--> 526 raise CalledProcessError(retcode, process.args,
527 output=stdout, stderr=stderr)
528 return CompletedProcess(process.args, retcode, stdout, stderr)
CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.