Hi
I am running a CNN model on pytorch
and i need to run it on gpu
my gpu is Nividia Quadro k4200 but i get the error message “CUDA error: no kernel image is available for execution on the device”
and a warning " Found GPU0 Quadro K4200 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."
I read that i can do it by compiling pytorch from source but it didn’t work out for me or i did something wrong somewhere.
i followed the instructions here https://github.com/pytorch/pytorch/blob/master/README.md#from-source
what else can i do?
Your Quadro K4200 has a compute capability of 3.0, while the binaries ship with >=3.7.
What kind of error are you seeing while compiling from source?
i don’t get any errors it just runs smoothly but still getting the same old gpu message
pytorch>python setup.py install
Building wheel torch-1.6.0a0+f41742f
– Building version 1.6.0a0+f41742f
cmake -GNinja -DBUILD_PYTHON=True -DBUILD_TEST=True -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR=Visual Studio 15 2017 -DCMAKE_GENERATOR_TOOLSET_VERSION=14.11 -DCMAKE_INSTALL_PREFIX=C:\Users\M-El Behery\pytorch\torch -DCMAKE_PREFIX_PATH=C:\Users\M-El Behery\anaconda3\Lib\site-packages -DNUMPY_INCLUDE_DIR=C:\Users\M-El Behery\anaconda3\lib\site-packages\numpy\core\include -DPYTHON_EXECUTABLE=C:\Users\M-El Behery\anaconda3\python.exe -DPYTHON_INCLUDE_DIR=C:\Users\M-El Behery\anaconda3\include -DPYTHON_LIBRARY=C:\Users\M-El Behery\anaconda3/libs/python37.lib -DTORCH_BUILD_VERSION=1.6.0a0+f41742f -DUSE_NUMPY=True C:\Users\M-El Behery\pytorch
CMake Error: Error: generator : Ninja
Does not match the generator used previously: Visual Studio 15 2017
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
Traceback (most recent call last):
File “setup.py”, line 739, in
build_deps()
File “setup.py”, line 321, in build_deps
cmake=cmake)
File “C:\Users\M-El Behery\pytorch\tools\build_pytorch_libs.py”, line 59, in build_caffe2
rerun_cmake)
File “C:\Users\M-El Behery\pytorch\tools\setup_helpers\cmake.py”, line 324, in generate
self.run(args, env=my_env)
File “C:\Users\M-El Behery\pytorch\tools\setup_helpers\cmake.py”, line 141, in run
check_call(command, cwd=self.build_dir, env=env)
File “C:\Users\M-El Behery\anaconda3\lib\subprocess.py”, line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘-GNinja’, ‘-DBUILD_PYTHON=True’, ‘-DBUILD_TEST=True’, ‘-DCMAKE_BUILD_TYPE=Release’, ‘-DCMAKE_GENERATOR=Visual Studio 15 2017’, ‘-DCMAKE_GENERATOR_TOOLSET_VERSION=14.11’, ‘-DCMAKE_INSTALL_PREFIX=C:\Users\M-El Behery\pytorch\torch’, ‘-DCMAKE_PREFIX_PATH=C:\Users\M-El Behery\anaconda3\Lib\site-packages’, ‘-DNUMPY_INCLUDE_DIR=C:\Users\M-El Behery\anaconda3\lib\site-packages\numpy\core\include’, ‘-DPYTHON_EXECUTABLE=C:\Users\M-El Behery\anaconda3\python.exe’, ‘-DPYTHON_INCLUDE_DIR=C:\Users\M-El Behery\anaconda3\include’, ‘-DPYTHON_LIBRARY=C:\Users\M-El Behery\anaconda3/libs/python37.lib’, ‘-DTORCH_BUILD_VERSION=1.6.0a0+f41742f’, ‘-DUSE_NUMPY=True’, ‘C:\Users\M-El Behery\pytorch’]’ returned non-zero exit status 1.
this is the message showed after running python setup.py install
I’m not deeply familiar with Windows, but these lines seem interesting:
Does not match the generator used previously: Visual Studio 15 2017
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
Could you remove the cache file etc. and rerun it?
python setup.py clean
might also work to get rid of these files.
i did remove the cache file and it still prints the same message
i ran it and still the same message after trying to install
@ptrblck i figured out i had the thing called ninja so when i tried to make the VS 2017 the generator i got that message above
when i ran it on he ninja generator it kept loading and printing alot of text when is searched for the word error i found this at the end
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘–build’, ‘.’, ‘–target’, ‘install’, ‘–config’, ‘Release’, ‘–’, ‘-j’, ‘36’]’ returned non-zero exit status 1.
how do i know that it was installed succesfully?
If the installation was successful, you should be able to import torch
and run some code.
Also, the log should print something like successfully installed torch...