Git Product home page Git Product logo

node-cuda's Introduction

node-cuda

node-cuda provides NVIDIA CUDA™ bindings for Node.js®.

Prerequisites

You will need to have a CUDA compatible GPU as well as the latest CUDA Drivers and Toolkit installed for your platform. Currently only tested on OSX and Linux 64-bit.

Installation

To obtain and build the bindings:

git clone git://github.com/kashif/node-cuda.git
cd node-cuda
node-gyp configure build

or install it via npm:

npm install node-cuda

node-cuda's People

Contributors

kashif avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-cuda's Issues

How do I put multiple parameters as arguments to the kernel function.

test.cu

__global__ void helloWorld(char *data) {

change
test.cu

__global__ void helloWorld(char *data, char *data2) {

cuda.js

module.exports.launch = function () {
  var func = arguments[0];
  var gridDim = arguments[1];
  var blockDim = arguments[2];
  var args = arguments[3];
  var args2= arguments[4];

  args = module.exports.prepareArguments(args);
  args2 = module.exports.prepareArguments(args2);

  return func.launchKernel(gridDim, blockDim, args, args2 );
}

function.cpp

Local<Object> buf = args[2]->ToObject();
  char *pbuffer = Buffer::Data(buf);
  size_t bufferSize = Buffer::Length(buf);

Local<Object> buf 2= args[3]->ToObject();
  char *pbuffer2 = Buffer::Data(buf2);
  size_t bufferSize2 = Buffer::Length(buf2);


void *cuKernel_Parameters= { &pbuffer , & pbuffer2}
 /*
 void *cuExtra[] = {
    CU_LAUNCH_PARAM_BUFFER_POINTER, pbuffer,
    CU_LAUNCH_PARAM_BUFFER_SIZE,    &bufferSize,
    CU_LAUNCH_PARAM_END
  };*/

  CUresult error = cuLaunchKernel(pfunction->m_function,
      gridDimX, gridDimY, gridDimZ,
      blockDimX, blockDimY, blockDimZ,
      0, 0, cuKernel_Parameters, NULL);

If i have access to an array data2 in kernel function, This code returns a 700 error.

node-cuda not found

hayashis@aprun2:~> npm install node-cuda
npm ERR! 404 404 Not Found: node-cuda
npm ERR! 404
npm ERR! 404 'node-cuda' is not in the npm registry.

Is this module removed from npm?

Doesn't compile on SUSE (11 SP1 x86_64)

node-cuda doesn't seem to compile on our cluster.

hayashis@aprun2:~/git/node-cuda> node-gyp configure
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn python
gyp info spawn args [ '/N/hd00/hayashis/BigRed2/node-v0.10.29-linux-x64/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/N/hd00/hayashis/BigRed2/git/node-cuda/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/N/hd00/hayashis/BigRed2/node-v0.10.29-linux-x64/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/N/u/hayashis/BigRed2/.node-gyp/0.10.29/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/N/u/hayashis/BigRed2/.node-gyp/0.10.29',
gyp info spawn args   '-Dmodule_root_dir=/N/hd00/hayashis/BigRed2/git/node-cuda',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok
hayashis@aprun2:~/git/node-cuda> node-gyp build
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/N/hd00/hayashis/BigRed2/git/node-cuda/build'
  CXX(target) Release/obj.target/cuda/src/bindings.o
  CXX(target) Release/obj.target/cuda/src/ctx.o
../src/ctx.cpp: In static member function âstatic v8::Handle<v8::Value> NodeCuda::Ctx::GetApiVersion(v8::Local<v8::String>, const v8::AccessorInfo&)â:
../src/ctx.cpp:165: warning: unused variable âerrorâ
../src/bindings.hpp: At global scope:
../src/bindings.hpp:12: warning: âv8::Handle<v8::Value> NodeCuda::GetDriverVersion(v8::Local<v8::String>, const v8::AccessorInfo&)â declared âstaticâ but never defined
../src/bindings.hpp:13: warning: âv8::Handle<v8::Value> NodeCuda::GetDeviceCount(v8::Local<v8::String>, const v8::AccessorInfo&)â declared âstaticâ but never defined
  CXX(target) Release/obj.target/cuda/src/device.o
../src/bindings.hpp:12: warning: âv8::Handle<v8::Value> NodeCuda::GetDriverVersion(v8::Local<v8::String>, const v8::AccessorInfo&)â declared âstaticâ but never defined
../src/bindings.hpp:13: warning: âv8::Handle<v8::Value> NodeCuda::GetDeviceCount(v8::Local<v8::String>, const v8::AccessorInfo&)â declared âstaticâ but never defined
  CXX(target) Release/obj.target/cuda/src/function.o
../src/bindings.hpp:12: warning: âv8::Handle<v8::Value> NodeCuda::GetDriverVersion(v8::Local<v8::String>, const v8::AccessorInfo&)â declared âstaticâ but never defined
../src/bindings.hpp:13: warning: âv8::Handle<v8::Value> NodeCuda::GetDeviceCount(v8::Local<v8::String>, const v8::AccessorInfo&)â declared âstaticâ but never defined
  CXX(target) Release/obj.target/cuda/src/mem.o
../src/bindings.hpp:12: warning: âv8::Handle<v8::Value> NodeCuda::GetDriverVersion(v8::Local<v8::String>, const v8::AccessorInfo&)â declared âstaticâ but never defined
../src/bindings.hpp:13: warning: âv8::Handle<v8::Value> NodeCuda::GetDeviceCount(v8::Local<v8::String>, const v8::AccessorInfo&)â declared âstaticâ but never defined
  CXX(target) Release/obj.target/cuda/src/module.o
../src/bindings.hpp:12: warning: âv8::Handle<v8::Value> NodeCuda::GetDriverVersion(v8::Local<v8::String>, const v8::AccessorInfo&)â declared âstaticâ but never defined
../src/bindings.hpp:13: warning: âv8::Handle<v8::Value> NodeCuda::GetDeviceCount(v8::Local<v8::String>, const v8::AccessorInfo&)â declared âstaticâ but never defined
  SOLINK_MODULE(target) Release/obj.target/cuda.node
flock: ./Release/linker.lock: Unknown error 524
make: *** [Release/obj.target/cuda.node] Error 65
make: Leaving directory `/N/hd00/hayashis/BigRed2/git/node-cuda/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/N/hd00/hayashis/BigRed2/node-v0.10.29-linux-x64/lib/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 2.6.32.59-0.7.1_1.0402.7496-cray_gem_s
gyp ERR! command "node" "/N/u/hayashis/BigRed2/node-v0.10.29-linux-x64/bin/node-gyp" "build"
gyp ERR! cwd /N/hd00/hayashis/BigRed2/git/node-cuda
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok

mac osx 10.8 build error

CXX(target) Release/obj.target/cuda/src/ctx.o
../src/ctx.cpp: In static member function ‘static v8::Handlev8::Value NodeCuda::Ctx::Synchronize(const v8::Arguments&)’:
../src/ctx.cpp:111: error: invalid conversion from ‘void ()(uv_work_t)’ to ‘void ()(uv_work_t, int)’
../src/ctx.cpp:111: error: initializing argument 4 of ‘int uv_queue_work(uv_loop_t_, uv_work_t_, void ()(uv_work_t), void ()(uv_work_t, int))’
../src/ctx.cpp: In static member function ‘static v8::Handlev8::Value NodeCuda::Ctx::GetApiVersion(v8::Localv8::String, const v8::AccessorInfo&)’:
../src/ctx.cpp:164: warning: unused variable ‘error’
../src/bindings.hpp: At global scope:
../src/bindings.hpp:12: warning: ‘v8::Handlev8::Value NodeCuda::GetDriverVersion(v8::Localv8::String, const v8::AccessorInfo&)’ declared ‘static’ but never defined
../src/bindings.hpp:13: warning: ‘v8::Handlev8::Value NodeCuda::GetDeviceCount(v8::Localv8::String, const v8::AccessorInfo&)’ declared ‘static’ but never defined
make: *** [Release/obj.target/cuda/src/ctx.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 12.3.0
gyp ERR! command "node" "/usr/local/bin/node-gyp" "build"
gyp ERR! cwd /Users/pergriffiths/node_modules/node-cuda
gyp ERR! node -v v0.10.6
gyp ERR! node-gyp -v v0.9.6
gyp ERR! not ok

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.