tsdf-fusion-python
tsdf-fusion-python copied to clipboard
Issue with pycuda- error invoking 'nvcc --version'
Hello,
Script works absolutely fine in CPU mode but its very slow. I was trying to debug the code and got stuck on this issue. I have installed all the required packages and also added below 2 lines to my .bashrc file
export PATH=/usr/local/cuda-10.1/bin${PATH:+:${PATH}}$
export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
Below is the error log from the console:
Connected to pydev debugger (build 191.7479.30) Estimating voxel volume bounds... Initializing voxel volume... Backend TkAgg is interactive backend. Turning interactive mode on. Voxel volume size: 405 x 264 x 289 Traceback (most recent call last): File "/home/mhv7rng/pycharm-community-2019.1.3/helpers/pydev/pydevd.py", line 1758, in
main() File "/home/mhv7rng/pycharm-community-2019.1.3/helpers/pydev/pydevd.py", line 1752, in main globals = debugger.run(setup['file'], None, None, is_module) File "/home/mhv7rng/pycharm-community-2019.1.3/helpers/pydev/pydevd.py", line 1147, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/home/mhv7rng/PycharmProjects/tsdf_fusion/demo.py", line 30, in tsdf_vol = fusion.TSDFVolume(vol_bnds,voxel_size=0.02) File "/home/mhv7rng/PycharmProjects/tsdf_fusion/fusion.py", line 133, in init }""") File "/home/mhv7rng/anaconda2/envs/don/lib/python2.7/site-packages/pycuda/compiler.py", line 291, in init arch, code, cache_dir, include_dirs) File "/home/mhv7rng/anaconda2/envs/don/lib/python2.7/site-packages/pycuda/compiler.py", line 254, in compile return compile_plain(source, options, keep, nvcc, cache_dir, target) File "/home/mhv7rng/anaconda2/envs/don/lib/python2.7/site-packages/pycuda/compiler.py", line 84, in compile_plain checksum.update(get_nvcc_version(nvcc).encode("utf-8")) File "</home/mhv7rng/anaconda2/envs/don/lib/python2.7/site-packages/decorator.pyc:decorator-gen-115>", line 2, in get_nvcc_version File "/home/mhv7rng/.local/lib/python2.7/site-packages/pytools/init.py", line 539, in _deco result = func(*args) File "/home/mhv7rng/anaconda2/envs/don/lib/python2.7/site-packages/pycuda/compiler.py", line 16, in get_nvcc_version result, stdout, stderr = call_capture_output(cmdline) File "/home/mhv7rng/.local/lib/python2.7/site-packages/pytools/prefork.py", line 227, in call_capture_output return forker.call_capture_output(cmdline, cwd, error_on_nonzero) File "/home/mhv7rng/.local/lib/python2.7/site-packages/pytools/prefork.py", line 61, in call_capture_output % (" ".join(cmdline), e)) pytools.prefork.ExecError: error invoking 'nvcc --version': [Errno 2] No such file or directory
Can you advice on how to solve this issue??
In case this error reported, open the compiler.py file and in the compile_plain function add the following line:
nvcc = '/usr/local/cuda/bin/' + nvcc
the compiler.py file is located in:
"/anaconda3/lib/python3.7/site-packages/pycuda-2020.1-py3.7-linux-x86_64.egg/pycuda/compiler.py"
So the final code will be something like this:
def compile_plain(source, options, keep, nvcc, cache_dir, target="cubin"):
from os.path import join
assert target in ["cubin", "ptx", "fatbin"]
nvcc = '/usr/local/cuda/bin/' + nvcc # --> here is the new line
if cache_dir:
checksum = _new_md5()
...
Save it and that's all