vchoutas / torch-mesh-isect

Other
295 stars 73 forks source link

RuntimeError: parallel_for failed: invalid configuration argument #6

Closed Mercurialzhang closed 5 years ago

Mercurialzhang commented 5 years ago

Thanks for your excellent work! I encountered some problems when running detect_and_plot_collisions.py in the example I install torch-mesh-isect with cuda10.1 gcc5.3 torch1.1 and python3.6

Details:

Number of triangles =  20908
Traceback (most recent call last):
  File "examples/detect_and_plot_collisions.py", line 81, in <module>
    outputs = m(triangles)
  File "/dockerdata/wellswzhang/venv_smplifyx/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/dockerdata/wellswzhang/venv_smplifyx/lib64/python3.6/site-packages/mesh_intersection-0.1.0-py3.6-linux-x86_64.egg/mesh_intersection/bvh_search_tree.py", line 56, in forward
    return BVHFunction.apply(triangles)
  File "/dockerdata/wellswzhang/venv_smplifyx/lib64/python3.6/site-packages/torch/autograd/grad_mode.py", line 43, in decorate_no_grad
    return func(*args, **kwargs)
  File "/dockerdata/wellswzhang/venv_smplifyx/lib64/python3.6/site-packages/mesh_intersection-0.1.0-py3.6-linux-x86_64.egg/mesh_intersection/bvh_search_tree.py", line 39, in forward
    max_collisions=BVHFunction.max_collisions)
RuntimeError: parallel_for failed: invalid configuration argument

Looking forward to your reply

Mercurialzhang commented 5 years ago

solved when set arch=sm_61, my gpu is Tesla M40 compile details:

bvh_extra_compile_args = {'nvcc': ['-DPRINT_TIMINGS=0', '-DDEBUG_PRINT=0',
                                   '-DERROR_CHECKING=1',
                                   '-DCOLLISION_ORDERING=1', '-arch=sm_61'],
w-m commented 5 years ago

I had the same issue on Ubuntu 18.04, Python 3.7, PyTorch 1.1.0, CUDA 10.0, with an Nvidia Titan Xp.

Thanks a lot @Mercurialzhang for the solution.

Note that if you already ran python setup.py install, changing the bvh_extra_compile_args will not lead to an automatic recompilation (at least not in my case). I had to touch src/bvh_cuda_op.cu to make sure the additional nvcc argument is used, before running python setup.py install again.

Cardinal2376 commented 4 years ago

Still Not work in CUDA 10.1, GTX 1060. I have already set the -arch=sm_61, but the problem remains.