Comments (8)
@jj0mst one workaround solution for not finding 'cuda.h' would be
CPATH=/usr/local/cuda-8.0/include ./make.sh
from stn.pytorch.
Take a look at #2.
I guess it might be one of possible ways to support gpu.
Best,
Jae Hyun
from stn.pytorch.
I solved it with a full reinstallation of cuda. Now the build is fine.
I proposed a change to stn.py that worked for me to run the module with cuda.
Warning: i had to manually modify the following line in make.sh:
nvcc -c -o my_lib_cuda_kernel.cu.o my_lib_cuda_kernel.cu -x cu -Xcompiler -fPIC -arch=sm_52
You have to specify in -arch the compute capability of your gpu (in my case i used -arch=sm_30 since i have gtx 850 with compute capability of 3.0) or the network will try to use ops that are not supported on your gpu.
If someone knows how, just change it to detect it automatically.
from stn.pytorch.
@jj0mst CUDA support is not fully integrated yet. Are you using make.sh
? You need to make sure the environment path CUDA_PATH
is set correctly.
from stn.pytorch.
The gpu support is still missing, by add cuda I mean grid generation support cuda now. Will add soon. Hang tight.
from stn.pytorch.
@lim0606 Thank you so much!
from stn.pytorch.
@fxia22 @lim0606 thanks for your work.
I'm trying to use the new cuda version but when i execute build.py i get the following error:
Including CUDA code.
/home/jj0/Downloads/stn.pytorch-master/script
generating /tmp/tmp118_y402/_my_lib.c
running build_ext
building '_my_lib' extension
creating home
creating home/jj0
creating home/jj0/Downloads
creating home/jj0/Downloads/stn.pytorch-master
creating home/jj0/Downloads/stn.pytorch-master/script
creating home/jj0/Downloads/stn.pytorch-master/script/src
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/jj0/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include -I/home/jj0/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/jj0/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC -I/home/jj0/anaconda3/include/python3.6m -c _my_lib.c -o ./_my_lib.o
In file included from /home/jj0/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THC.h:4:0,
from _my_lib.c:434:
/home/jj0/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/../../lib/include/THC/THCGeneral.h:9:18: fatal error: cuda.h: No such file or directory
#include "cuda.h"
^
compilation terminated.
Traceback (most recent call last):
File "/home/jj0/anaconda3/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile
extra_postargs)
File "/home/jj0/anaconda3/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/home/jj0/anaconda3/lib/python3.6/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/home/jj0/anaconda3/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
% (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/jj0/anaconda3/lib/python3.6/site-packages/cffi/ffiplatform.py", line 58, in _build
dist.run_command('build_ext')
File "/home/jj0/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/jj0/anaconda3/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/home/jj0/anaconda3/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/home/jj0/anaconda3/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/home/jj0/anaconda3/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
depends=ext.depends)
File "/home/jj0/anaconda3/lib/python3.6/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/home/jj0/anaconda3/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command 'gcc' failed with exit status 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "build.py", line 35, in <module>
ffi.build()
File "/home/jj0/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 164, in build
_build_extension(ffi, cffi_wrapper_name, target_dir, verbose)
File "/home/jj0/anaconda3/lib/python3.6/site-packages/torch/utils/ffi/__init__.py", line 100, in _build_extension
ffi.compile(tmpdir=tmpdir, verbose=verbose, target=libname)
File "/home/jj0/anaconda3/lib/python3.6/site-packages/cffi/api.py", line 672, in compile
compiler_verbose=verbose, debug=debug, **kwds)
File "/home/jj0/anaconda3/lib/python3.6/site-packages/cffi/recompiler.py", line 1475, in recompile
compiler_verbose, debug)
File "/home/jj0/anaconda3/lib/python3.6/site-packages/cffi/ffiplatform.py", line 29, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/jj0/anaconda3/lib/python3.6/site-packages/cffi/ffiplatform.py", line 65, in _build
raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.ffiplatform.VerificationError: CompileError: command 'gcc' failed with exit status 1
It seems the problem is that it can't find cuda.h, but i correctly installed it and i already used it with the other pytorch modules without any problems.
Should i modify the path somewhere to specify my cuda.h location?
from stn.pytorch.
@lim0606 @jj0mst I tested the cuda version, it is 6x-10x faster than CPU version. Good job guys! Let me know if there are any further problems.
from stn.pytorch.
Related Issues (20)
- output blank image HOT 10
- error in BilinearSampler.updateOutput: invalid device function HOT 4
- nan gradients with BCHW layout
- compatibility with DataParallel
- Bug with 'BCHW' version & Question about high CPU utilization when in GPU mode
- cuda runtime error HOT 5
- cannot compute gradients when STN is called multiple times HOT 2
- Why is there a lr parameter in AffineGridGenFunction ?
- STN added to Pytorch by Soumith Chintala HOT 4
- can you add a TPS grid generator in this awesome project~?
- Windows support ?
- Runtime error: dimension out of range HOT 1
- Upgrade to mxnet 1.0
- How can I run make.sh in my MacOSX terminal? HOT 1
- How to use stn for 3D transform? HOT 4
- how to run the demo
- How can it do backpropogation? HOT 1
- TypeError: dist must be a Distribution instance HOT 1
- BCHW format HOT 13
- Bug in gpu support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stn.pytorch.