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

RuntimeError: Ninja is required to load C++ extensions #4

Closed
qiuxin610 opened this issue Mar 13, 2024 · 4 comments
Closed

RuntimeError: Ninja is required to load C++ extensions #4

qiuxin610 opened this issue Mar 13, 2024 · 4 comments

Comments

@qiuxin610
Copy link

qiuxin610 commented Mar 13, 2024

CRM.pth: 100%|███████████████████████████████████████████████████████████████████████| 476M/476M [13:35<00:00, 583kB/s]
Traceback (most recent call last):
File "E:\project\CRM\app.py", line 129, in
model = CRM(specs).to(args.device)
File "E:\project\CRM\model\crm\model.py", line 59, in init
self.renderer = Renderer(tet_grid_size=self.tet_grid_size, camera_angle_num=self.camera_angle_num,
File "E:\project\CRM\util\renderer.py", line 15, in init
self.glctx = dr.RasterizeCudaContext()
File "E:\project\CRM\python\lib\site-packages\nvdiffrast\torch\ops.py", line 177, in init
self.cpp_wrapper = _get_plugin().RasterizeCRStateWrapper(cuda_device_idx)
File "E:\project\CRM\python\lib\site-packages\nvdiffrast\torch\ops.py", line 118, in _get_plugin
torch.utils.cpp_extension.load(name=plugin_name, sources=source_paths, extra_cflags=opts, extra_cuda_cflags=opts+['-lineinfo'], extra_ldflags=ldflags, with_cuda=True, verbose=False)
File "E:\project\CRM\python\lib\site-packages\torch\utils\cpp_extension.py", line 1306, in load
return _jit_compile(
File "E:\project\CRM\python\lib\site-packages\torch\utils\cpp_extension.py", line 1710, in _jit_compile
_write_ninja_file_and_build_library(
File "E:\project\CRM\python\lib\site-packages\torch\utils\cpp_extension.py", line 1793, in _write_ninja_file_and_build_library
verify_ninja_availability()
File "E:\project\CRM\python\lib\site-packages\torch\utils\cpp_extension.py", line 1842, in verify_ninja_availability
raise RuntimeError("Ninja is required to load C++ extensions")
RuntimeError: Ninja is required to load C++ extensions
E:\project\CRM>python\python.exe -m pip install Ninja
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Requirement already satisfied: Ninja in e:\project\crm\python\lib\site-packages (1.11.1.1)

@thuwzy
Copy link
Collaborator

thuwzy commented Mar 13, 2024

What is the version of your python, pytorch and cuda? It seems to be related with the cuda version.

@qiuxin610
Copy link
Author

python 3.9.12 torch 2.2.0+cu121 cuda 12.3

@thuwzy
Copy link
Collaborator

thuwzy commented Mar 20, 2024

My testing environment is torch==1.13.0+cu117. You can try torch 1.x?

@qiuxin610
Copy link
Author

ok The problem is solved. I found a winodws ninja.exe that can run in 2.2.0+cu121.

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