Error when installing pytorch from source

Hi, I want to use Pytorch with Quadro K3100M which is of Cuda capability 3.0. But i get this error :
" Found GPU0 Quadro K3100M which is of Cuda capability 3.0.
PyTorch no longer supports this GPU because it is too old.
The minimum Cuda capability that we support is 3.5. "

So, I did some research and found that i should have installed Pytorch from source, therefore i am trying to do it. But after i run “python install”, i get this error :

[3894/5004] Building NVCC (Device) obj…
FAILED: caffe2/CMakeFiles/torch_cuda.dir//aten/src/THC/generated/
cd /home/ionur1/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/
/aten/src/THC/generated && /home/ionur1/anaconda3/envs/conda_env/bin/cmake -E make_directory /home/ionur1/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir//aten/src/THC/generated/. && /home/ionur1/anaconda3/envs/conda_env/bin/cmake -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=/home/ionur1/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir//aten/src/THC/generated/./ -D generated_cubin_file:STRING=/home/ionur1/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir//aten/src/THC/generated/./ -P /home/ionur1/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir//aten/src/THC/generated/
/home/ionur1/pytorch/aten/src/THC/THCDeviceUtils.cuh(38): error: identifier “__ldg” is undefined
detected during:
instantiation of “T doLdg(const T *) [with T=int16_t]”
/home/ionur1/pytorch/aten/src/ATen/native/cuda/SortingRadixSelect.cuh(201): here
instantiation of “void at::native::countRadixUsingMask<scalar_t,bitwise_t,index_t,CountType,RadixSize,RadixBits>(CountType *, CountType *, bitwise_t, bitwise_t, int, index_t, index_t, scalar_t *) [with scalar_t=int16_t, bitwise_t=uint32_t, index_t=uint32_t, CountType=int, RadixSize=4, RadixBits=2]”
/home/ionur1/pytorch/aten/src/ATen/native/cuda/SortingRadixSelect.cuh(337): here
instantiation of “void at::native::radixSelect<scalar_t,bitwise_t,index_t,Order>(scalar_t *, index_t, index_t, index_t, int *, scalar_t *) [with scalar_t=int16_t, bitwise_t=uint32_t, index_t=uint32_t, Order=true]”
/home/ionur1/pytorch/aten/src/THC/THCTensorTopK.cuh(69): here
instantiation of “void gatherTopK<T,IndexType,Dim,Order>(TensorInfo<T, IndexType>, IndexType, IndexType, IndexType, IndexType, TensorInfo<T, IndexType>, IndexType, IndexType, TensorInfo<int64_t, IndexType>, IndexType) [with T=int16_t, IndexType=uint32_t, Dim=1, Order=true]”
/home/ionur1/pytorch/aten/src/THC/generic/ here

1 error detected in the compilation of “/tmp/tmpxft_0000297e_00000000-6_THCTensorTopKShort.cpp1.ii”.
CMake Error at (message):
Error generating file

[3901/5004] Building NVCC (Device) obj…
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File “”, line 724, in
File “”, line 312, in build_deps
File “/home/ionur1/pytorch/tools/”, line 62, in build_caffe2
File “/home/ionur1/pytorch/tools/setup_helpers/”, line 346, in build, my_env)
File “/home/ionur1/pytorch/tools/setup_helpers/”, line 141, in run
check_call(command, cwd=self.build_dir, env=env)
File “/home/ionur1/anaconda3/envs/conda_env/lib/python3.8/”, line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘–build’, ‘.’, ‘–target’, ‘install’, ‘–config’, ‘Release’, ‘–’, ‘-j’, ‘8’]’ returned non-zero exit status 1.

Note: I tried to run with python and python3, nothing has changed. I activated conda environment before running the commands.

OS: Ubuntu 18.04.1 LTS
CUDA Version 10.2.89
cudNN Version 7603
Python : 3.8.5
GPU : GPU0 Quadro K3100M
GCC version : 8.4.0

I would like to be very glad if you help me about this.

As stated in the error message, the minimal compute capability is 3.5, since e.g. __ldg is defined for >=3.5 as seen here.