FileNotFoundError: [Errno 2] No such file or directory: 'nvcc': 'nvcc

Traceback (most recent call last):
File “/media/cyoung/000E88CC0009670E/projectCV/implement_tvm/tvm_handson/compiling_model/main.py”, line 24, in
net, target, shape={“data”: data_shape}, params=params)
File “/home/cyoung/.local/lib/python3.6/site-packages/nnvm-0.8.0-py3.6.egg/nnvm/compiler/build_module.py”, line 304, in build
graph = graph.apply(“GraphCompile”)
File “/home/cyoung/.local/lib/python3.6/site-packages/nnvm-0.8.0-py3.6.egg/nnvm/graph.py”, line 234, in apply
check_call(_LIB.NNGraphApplyPasses(self.handle, npass, cpass, ctypes.byref(ghandle)))
File “/home/cyoung/.local/lib/python3.6/site-packages/nnvm-0.8.0-py3.6.egg/nnvm/_base.py”, line 75, in check_call
raise NNVMError(py_str(_LIB.NNGetLastError()))
nnvm._base.NNVMError: TVMCall CFunc Error:
Traceback (most recent call last):
File “tvm/_ffi/_cython/./function.pxi”, line 38, in tvm._ffi._cy3.core.tvm_callback
File “/home/cyoung/.local/lib/python3.6/site-packages/nnvm-0.8.0-py3.6.egg/nnvm/compiler/build_module.py”, line 124, in _build
return tvm.build(funcs, target=target, target_host=target_host)
File “/home/cyoung/.local/lib/python3.6/site-packages/tvm-0.4.0-py3.6-linux-x86_64.egg/tvm/build_module.py”, line 504, in build
mdev = codegen.build_module(fdevice, str(target_device))
File “/home/cyoung/.local/lib/python3.6/site-packages/tvm-0.4.0-py3.6-linux-x86_64.egg/tvm/codegen.py”, line 20, in build_module
return _Build(lowered_func, target)
File “/home/cyoung/.local/lib/python3.6/site-packages/tvm-0.4.0-py3.6-linux-x86_64.egg/tvm/_ffi/function.py”, line 280, in my_api_func
return flocal(*args)
File “tvm/_ffi/_cython/./function.pxi”, line 267, in tvm._ffi._cy3.core.FunctionBase.call
File “tvm/_ffi/_cython/./function.pxi”, line 216, in tvm._ffi._cy3.core.FuncCall
File “tvm/_ffi/_cython/./function.pxi”, line 208, in tvm._ffi._cy3.core.FuncCall3
File “tvm/_ffi/_cython/./base.pxi”, line 143, in tvm._ffi._cy3.core.CALL
tvm._ffi.base.TVMError: TVMCall CFunc Error:
Traceback (most recent call last):
File “tvm/_ffi/_cython/./function.pxi”, line 38, in tvm._ffi._cy3.core.tvm_callback
File “/home/cyoung/.local/lib/python3.6/site-packages/tvm-0.4.0-py3.6-linux-x86_64.egg/tvm/autotvm/measure/measure_methods.py”, line 489, in tvm_callback_cuda_compile
ptx = nvcc.compile_cuda(code, target=“ptx”, arch=AutotvmGlobalScope.current.cuda_target_arch)
File “/home/cyoung/.local/lib/python3.6/site-packages/tvm-0.4.0-py3.6-linux-x86_64.egg/tvm/contrib/nvcc.py”, line 69, in compile_cuda
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
File “/home/cyoung/miniconda3/lib/python3.6/subprocess.py”, line 709, in init
restore_signals, start_new_session)
File “/home/cyoung/miniconda3/lib/python3.6/subprocess.py”, line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: ‘nvcc’: ‘nvcc’

cmd nvcc -V:
nvcc: NVIDIA ® Cuda compiler driver
Copyright © 2005-2017 NVIDIA Corporation
Built on Mon_Jun_26_16:13:28_CDT_2017
Cuda compilation tools, release 9.0, V9.0.102

I already add CUDA bin PATH:
export PATH=$PATH:/usr/local/cuda/bin

still given this error!

I fixed this already.Once I made the requisite changes to /etc/environment to add for /usr/local/cuda/bin it was all good.

2 Likes

sudo vim ~/.bashrc

export PATH=/usr/local/cuda/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

source ~/.bashrc

hello when i use pycharm, face this porblem also, can you discribe the details? thanks