GLVisualize.jl icon indicating copy to clipboard operation
GLVisualize.jl copied to clipboard

Integration with CUBLAS/CLBLAS?

Open dlfivefifty opened this issue 9 years ago • 8 comments

Does GLVisualize integrate well with any of the GPU programming packages? For example,

https://github.com/JuliaGPU/CLBLAS.jl

or

https://github.com/JuliaGPU/CUBLAS.jl

It would be nice to do the computation and plotting all on the GPU 😀

dlfivefifty avatar Apr 26 '16 04:04 dlfivefifty

That is our secret master plan :) @SimonDanisch once experimented with OpenCL -> OpenGl interop, but we didn't get very far and I don't think anything has been done in that direction.

vchuravy avatar Apr 26 '16 06:04 vchuravy

I have to correct you @vchuravy, I actually put ArrayFire and CUDArt integration into the mix since then ;) So this should also work with CUBLAS and CLBLAS, if they don't do anything weird. It happened quite recently and I haven't found time to nicely integrate it yet... But if you want to, I can share a few scripts which should get you started!

SimonDanisch avatar Apr 26 '16 08:04 SimonDanisch

Please do share :)

vchuravy avatar Apr 26 '16 09:04 vchuravy

ArrayFire looks really cool! Exactly what I need I think...

Sent from my iPhone

On 26 Apr 2016, at 18:44, Simon [email protected] wrote:

I have to correct you @vchuravy, I actually put (ArrayFire)[https://github.com/JuliaComputing/ArrayFire.jl] and CUDArt integration into the mix since then ;) So this should also work with CUBLAS and CLBLAS, if they don't do anything weird. It happened quite recently and I haven't found time to nicely integrate it yet... But if you want to, I can share a few scripts which should get you started!

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

dlfivefifty avatar Apr 26 '16 10:04 dlfivefifty

It is pretty cool :) It has some performance problems, but I hope they're easily fixable (it consumes way too much GPU memory in my trivial example). But this is probably a problem with the Julia wrapper and might be fixed soon. Also, I wasn't using inplace operations and I'd be surprised if ArrayFire doesn't actually offer inplace variants in some way.

Here is how you can try things out:

# Cxx must be installed and working!
Pkg.checkout("CUDArt", "sd/gl_interop")
Pkg.clone("https://github.com/JuliaGPU/ArrayFire.jl")
Pkg.checkout("GLVisualize", "sd/gpgpu")
Pkg.checkout("GLWindow")

then you can try out the gravity notebook Haven't tried this out on any other machine yet and it took me quite a while to set up everything correctly, so this might as well not work out of the box...

SimonDanisch avatar Apr 26 '16 11:04 SimonDanisch

The plan is to add this painlessly, by putting the interop code into GLAbstraction/AbstractGPU array and make GLVisualize accept any kind of GPUArray, which should be pretty straight forward ;)

SimonDanisch avatar Apr 26 '16 11:04 SimonDanisch

@SimonDanisch how are you able to get cxx.jl working on windows :O . ?

musm avatar Apr 27 '16 12:04 musm

I'm not :( So this is OSX/Linux only so far...

SimonDanisch avatar Apr 27 '16 17:04 SimonDanisch