Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues installing on Linux with nvidia #55

Open
tiagoantao opened this Issue Mar 16, 2017 · 42 comments

Comments

Projects
None yet
4 participants
@tiagoantao
Copy link

tiagoantao commented Mar 16, 2017

When I installed node-opencl and run the examples, I got an immediate segmentation fault.
My configuration is as follows:

  • Ubuntu 16.04
  • Nvidia Tesla K40
  • NVidia OpenCL bindings that are v 1.2 (not 2)

It so happens that the opencl headers that are made available with ubuntu (package opencl-headers) are 2.0

This means that, for example, commandqueue.cpp #ifndef CL_VERSION_2_0 will add the wrong function on compilation.

My hack was to edit the headers and undefine CL_VERSION_2_0

I do not have the experience to make a recommendation here, maybe this is just a problem with the way things are set up on ubuntu, but I think one of these might work

  • document this so that people are aware OR
  • detect the openCL version of the device in a different, more dynamic way
@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Nov 17, 2017

Did you get any further here?

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Nov 17, 2017

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Nov 17, 2017

It looks like this library will be used by http://gpu.rocks, fyi. You think there will be sufficient support?

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Nov 17, 2017

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Nov 17, 2017

exactly. the architectural layer would give us a means of finally having a full on GPU + js api. Design in simple js, execute... everywhere.

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Nov 17, 2017

This is my exact issue on Ubuntu:

>  require('node-opencl/examples/saxpy');
SAXPY with vector size: 524288 elements
using device: GeForce GTX 1080 Ti
node: relocation error: /home/usergpu/node_modules/node-opencl/build/Release/opencl.node: symbol clCreateCommandQueueWithProperties, version OPENCL_2.0 not defined in file libOpenCL.so.1 with link time reference
@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Nov 17, 2017

I can provide ssh if you like.

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Nov 17, 2017

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Nov 17, 2017

Do you know what turnaround time will be? No rush.

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Nov 17, 2017

Also: this is so exciting!

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Nov 17, 2017

@TheLarkInn

This comment has been minimized.

Copy link

TheLarkInn commented Feb 15, 2018

Bumping for status. I'm very very very interested in this endeavor especially for NodeJS core, and our library webpack for parallel processing.

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Feb 16, 2018

@mikeseven did you get around to it yet?

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Feb 16, 2018

I haven't tested extensively but it has been in feature branch for a while.

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Feb 16, 2018

Nice: https://github.com/mikeseven/node-opencl/tree/feature/upgrade_to_NAN_2.8.0
So we just need to test, give feedback here, and based off that, improve and release or just release?

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Feb 16, 2018

@TheLarkInn

This comment has been minimized.

Copy link

TheLarkInn commented Feb 16, 2018

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Feb 16, 2018

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Feb 18, 2018

the benefit of gpu.js, with node-opencl (planned, in prototype stage) is that you won't have to learn any of it, just plain old good fashion javascript.

😎

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Feb 19, 2018

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Feb 19, 2018

As a developer of I can say: GPU.js uses webgl as one of its rendering targets, along with javascript, but it will use opencl soon as another: gpujs/gpu.js#52

It'd be easy to add any number of targets that don't support graphics backends.

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Feb 19, 2018

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Feb 19, 2018

To use opencl as backend, it would need to be outside the browser

Already done. GPU.js originally only used webgl, but now compiles a kernel just fine on node. So GPU.js has both node support and browser and handles typed arrays like Float32Array, just fine. Because we built it to work in a specific kernel environment, type detection is actually super easy.

Note: yes GPU.js actually compiles a javascript kernel, in javascript. This is done for performance, and... well, just because we can.

The javascript is compiled directly to whatever environment we need. It doesn't currently support an opencl kernel, which is why I started getting involved in this thread in the first place, all we need is a means of computing the numbers, that is easily installable. After that, the GPU.js library takes care of the rest. An example would be compiling a kernel similar to how it is done here in your unit tests: https://github.com/mikeseven/node-opencl/blob/master/test/test.kernel.js#L65

In short the javascript is compiled one to one with the subset of c++ environment (webgl or planned opencl, in the future: arrayfire, cuda, or perhaps webcl if it ever materializes).

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Feb 19, 2018

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Feb 20, 2018

Tried to install, this is what I get:

M86510-4:gpu.js robert.plummer$ npm i git://github.com/mikeseven/node-opencl.git#7d2de1fbddbd914e1baa41e3ed80287c717c583c
npm WARN deprecated pngjs2@2.0.0: pngjs2 has now taken over the original pngjs package on npm. Please change to use pngjs dependency, version 2+.

> node-opencl@0.5.0 install /Users/robert.plummer/20% Time/gpu.js/node_modules/node-opencl
> node-gyp rebuild --msvs_version=auto

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
  CXX(target) Release/obj.target/opencl/src/addon.o
  CXX(target) Release/obj.target/opencl/src/types.o
  CXX(target) Release/obj.target/opencl/src/common.o
  CXX(target) Release/obj.target/opencl/src/commandqueue.o
  CXX(target) Release/obj.target/opencl/src/context.o
  CXX(target) Release/obj.target/opencl/src/device.o
  CXX(target) Release/obj.target/opencl/src/event.o
  CXX(target) Release/obj.target/opencl/src/kernel.o
  CXX(target) Release/obj.target/opencl/src/memobj.o
  CXX(target) Release/obj.target/opencl/src/pipe.o
  CXX(target) Release/obj.target/opencl/src/platform.o
  CXX(target) Release/obj.target/opencl/src/program.o
  CXX(target) Release/obj.target/opencl/src/sampler.o
  CXX(target) Release/obj.target/opencl/src/svm.o
  SOLINK_MODULE(target) Release/opencl.node
gpu.js@1.0.0-rc.8 /Users/robert.plummer/20% Time/gpu.js
+-- bluebird@3.5.0  extraneous
+-- node-opencl@0.5.0  invalid (git://github.com/mikeseven/node-opencl.git#7d2de1fbddbd914e1baa41e3ed80287c717c583c)
| +-- chai@4.1.2
| | +-- assertion-error@1.1.0 
| | `-- type-detect@4.0.8 
| +-- get-pixels@3.3.0
| | `-- omggif@1.0.9 
| `-- nan@2.8.0 
`-- node-pre-gyp@0.6.36 

M86510-4:gpu.js robert.plummer$ 
@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Feb 20, 2018

I ran it once more, using save, and this time no warnings:

M86510-4:gpu.js robert.plummer$ npm i --save git://github.com/mikeseven/node-opencl.git#7d2de1fbddbd914e1baa41e3ed80287c717c583c
npm WARN deprecated pngjs2@2.0.0: pngjs2 has now taken over the original pngjs package on npm. Please change to use pngjs dependency, version 2+.

> node-opencl@0.5.0 install /Users/robert.plummer/20% Time/gpu.js/node_modules/node-opencl
> node-gyp rebuild --msvs_version=auto

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
  CXX(target) Release/obj.target/opencl/src/addon.o
  CXX(target) Release/obj.target/opencl/src/types.o
  CXX(target) Release/obj.target/opencl/src/common.o
  CXX(target) Release/obj.target/opencl/src/commandqueue.o
  CXX(target) Release/obj.target/opencl/src/context.o
  CXX(target) Release/obj.target/opencl/src/device.o
  CXX(target) Release/obj.target/opencl/src/event.o
  CXX(target) Release/obj.target/opencl/src/kernel.o
  CXX(target) Release/obj.target/opencl/src/memobj.o
  CXX(target) Release/obj.target/opencl/src/pipe.o
  CXX(target) Release/obj.target/opencl/src/platform.o
  CXX(target) Release/obj.target/opencl/src/program.o
  CXX(target) Release/obj.target/opencl/src/sampler.o
  CXX(target) Release/obj.target/opencl/src/svm.o
  SOLINK_MODULE(target) Release/opencl.node
gpu.js@1.0.0-rc.8 /Users/robert.plummer/20% Time/gpu.js
+-- bluebird@3.5.0  extraneous
+-- node-opencl@0.5.0  (git://github.com/mikeseven/node-opencl.git#7d2de1fbddbd914e1baa41e3ed80287c717c583c)
`-- node-pre-gyp@0.6.36 
@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Feb 20, 2018

I believe that means, we are release ready?

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Feb 20, 2018

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Feb 20, 2018

When I try one of the examples, I get cl.createContextFromType is not a function, I'm assuming I'm not doing something right. I did try just building a kernel, without running it, and it ran perfectly.

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Feb 20, 2018

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Feb 20, 2018

It is, sadly: https://support.apple.com/en-us/HT202823

Is there v1 example you could point me to?

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Feb 21, 2018

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Feb 21, 2018

fantastic!

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Feb 25, 2018

any updates? Things are moving fast, and want to be able to use soon.

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Feb 25, 2018

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Feb 25, 2018

nice

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Feb 25, 2018

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Mar 18, 2018

It builds, but when I run unit tests (which are fantastically written) I get 72 failures, and then then error Command failed with exit code 72.. But a lot of them pass. Is that normal? If it is normal, can we get labels perhaps on the tests that identify them as to fail under what conditions?

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Mar 18, 2018

fyi: all examples work 100%
I'd say at the very least, you have a release candidate.

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Mar 18, 2018

@robertleeplummerjr

This comment has been minimized.

Copy link

robertleeplummerjr commented Mar 18, 2018

What do you think timeline will be on the next release that allows for opencl 1.2 on Apple?

@mikeseven

This comment has been minimized.

Copy link
Owner

mikeseven commented Mar 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.