I update my pytorch source code version from github when I install it I got many errors related to this
error: there are no arguments to ‘THDGetCudaState’ that depend on a template parameter, so a declaration of ‘THDGetCudaState’ must be available [-fpermissive]
auto cuda_stream = THCState_getCurrentStream(THDGetCudaState());
by the way at the begining I got this even though cuda is installed and I’m already using pytorch on GPU
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "5.5")
-- Found gcc >=5 and CUDA <= 7.5, adding workaround C++ flags
-- Automatic GPU detection failed. Building for common architectures.
-- Autodetected CUDA architecture(s): 3.0;3.5;5.0;5.2+PTX
-- Could not find CUDA with FP16 support, compiling without torch.CudaHalfTensor
-- Removing -DNDEBUG from compile flags
-- Compiling with OpenMP support
-- MAGMA not found. Compiling without MAGMA support
-- Could not find hardware support for NEON on this machine.
-- No OMAP3 processor on this machine.
-- No OMAP4 processor on this machine.
-- SSE2 Found
-- SSE3 Found
-- AVX Found
-- AVX2 Found
The last release that has been done can be found from the website in the installation instructions.
The last version under development is the current master branch on the github repo.
You were looking for something else?
As stated in the error message, I think you should set the CUDA_TOOLKIT_ROOT_DIR environment variable.
Also, I would advise against using sudo to install pytorch as when you use it, you loose all the env variables that you have such as possibly LD_LIBRARY_PATH or other useful stuff.