Updating pytorch issues

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

You may want to run a python setup.py clean and git submodule update --init before building after pulling from master.

Thanks, this is solved my problem. could you give a link to check what is the last version of pytorch ?

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?

I think I compiled pytorch without CUDA

AssertionError: Torch not compiled with CUDA enabled

I checked with this line
sudo CUDA_HOME="/usr/local/cuda-9.0" python3 setup.py install
it gave me error that it can’t find cuda

CMake Error at /usr/src/pytorch/cmake/FindCUDA/FindCUDA.cmake:644 (message):
  Specify CUDA_TOOLKIT_ROOT_DIR

I don’t understand I have cuda-9.0 installed and I was just using pytorch and theano on cuda. but I can’t run nvcc

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.

I have my environment set

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

and I can’t install it without sudo because the user doesn’t have a permission

I can’t figure out what is wrong. I was just using pytorch on GPU 10 min ago and now I can’t because cuda tool kit doesn’t exist and I can’t find nvcc

To be able to install python packages as a user without sudo, you should just add the user to the staff group.