Giter Club home page Giter Club logo

Comments (8)

silverbottlep avatar silverbottlep commented on June 18, 2024 7

@jj0mst one workaround solution for not finding 'cuda.h' would be
CPATH=/usr/local/cuda-8.0/include ./make.sh

from stn.pytorch.

lim0606 avatar lim0606 commented on June 18, 2024 2

Take a look at #2.

I guess it might be one of possible ways to support gpu.

Best,

Jae Hyun

from stn.pytorch.

jj0mst avatar jj0mst commented on June 18, 2024 2

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.

fxia22 avatar fxia22 commented on June 18, 2024 1

@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.

fxia22 avatar fxia22 commented on June 18, 2024

The gpu support is still missing, by add cuda I mean grid generation support cuda now. Will add soon. Hang tight.

from stn.pytorch.

fxia22 avatar fxia22 commented on June 18, 2024

@lim0606 Thank you so much!

from stn.pytorch.

jj0mst avatar jj0mst commented on June 18, 2024

@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.

fxia22 avatar fxia22 commented on June 18, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.