Opencl or Sycl

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Opencl or Sycl

Postby JoeJ » Fri Feb 11, 2022 1:47 pm

JoshKlint wrote:having never used them before in any API.

I recommend reading the CS chapter of OpenGL Super Bible. Becasue it introduces the parallel programming model so well with good examples. Still applies to Vulkan. Most enlighting read i've ever had :)

I would say VK needs 10 times more API code than OpenCL. E.g. to upload memory to to GPU, you need to create a temporary staging buffer, copy it there, make a command buffer containing GPU copy commands and sync, upload the command buffer, execute it.
With OpenCL, all this is just one line of code.

To run kernels, you need to create pipeline layouts to specify memory buffers it uses, Make command buffers again containing kernel dispatch and memory barriers to sync.

But the complexity has upsides. Once all this is created, a single command buffer execution per frame can run your whole pipeline. There is no more need to orchestrate each dispatch and barriers from CPU, which is very slow. This gave me speedup of 2 over OpenCL for a project having hundrets of dispatches. Also the kernels themselves run usually faster than the same in OpenCL.
Feature set of the GLSL language is the same as CL 1.x, just pointers are missing. No OOP ofc.

I also found it easy to get going. Rendering with Vulkan is crazy complex, but compute shaders is pretty simple. Once some basic example is working, we can make abstractions to make it as easy to use as OpenCL.

The same would apply to DX12.

It's the only proper way, imo.
But i do not want to use it for general GPGPU things either. I would profit a lot from speeding up my fluid sim, for example. But if i port it, i have to maintain both GPU and CPU branches. And i won't do twice the work until i'm sure the simulator won't change a lot anymore.

Imo, OpenCL also missed the goal of having portable code for both CPU and GPU. Obviously - because GPU parallel programming is very different from CPU multi threading, and scalar GPU threads also differ from CPU SIMD just too much.
Using the same code for both can only work in few cases. Though, a physics solver probably is one of these.

Sadly i don't know anything about the options of using main memory directly on GPU, which would be very attractive here ofc.
AMD GCN GPUs have 256 MB of shared memory, but idk if it's on main ram or vram, and how using this would disable caching eventually.
Recent GPUs from both NV and AMD can now map the whole main ram afaik.
And pointers have been recently introduced to Vulkan, but are still lacking from DX12 afaik.
If there would be serious interest for physics on GPU, that's the first thing i'd try to clarify in detail.

They do not even deal with plain cpp classes.

No, but you could do your own CPP -> SpirV compiler, haha :mrgreen:
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Opencl or Sycl

Postby JoeJ » Fri Feb 11, 2022 1:54 pm

...some people seriously consider this:
https://dl.acm.org/doi/fullHtml/10.1145/3456669.3456683

But well. Personally i'll just wait and see. (... probably for another decade :roll: )
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Opencl or Sycl

Postby Julio Jerez » Sat Feb 12, 2022 6:47 pm

I now installed me nvidia 730,
is quiet a wimpy gpu. compared to the amd RX 480
but I think it is enough to get start with CUDA.

It may not be supported, I try the latest drive and NVidia itself say they do not support the hardware since 2017, so it is stuck in CUDA 2.1
I may not even have C++ Cuda support.

them I see if I can but a better NVidia GPU.

edit:
I ordered a NVidia 1660 ultra from amazon

it goes for $700.00 without tax and shipment, so it is not cheap even though is 3 generation behind legacy hardware and the list price was under 200.00.
But it is the best I can use in my pc which has 600 watts power supply.
those other 2050 and 2060's requires 800 and 1000 watt power supply.
so I wait for that to arrive, and I will try CUDA. see how that goes.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Opencl or Sycl

Postby JoeJ » Sun Feb 13, 2022 4:20 am

So you joined the fallacy of premium paying miners / enthusiast gamers :D
For 700 you could almost get a laptop with 1660 M Ti, which has 4.8 TF while 1660 has 5.
A 2060 should work with a 450 Watt PSU, according to techpowerup.
I use 600 Watt PSU for my Vega56, which has 10 TF without issues.

This platform really has a problem. I could get XBox S for 270.
I doubt we ever get back to normal, even after chip crisis is over :|
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Opencl or Sycl

Postby Julio Jerez » Sun Feb 13, 2022 11:33 am

yes everyone is scalping now, this card should be $150, some places have it listed at $450 but they do not have in stock.

This is a GTX 1660 super, not even the best of that line, on paper it seems inferior to the amd rx 480
but in bench mark I seem, is way faster some time even twice as fast.

The band width is limited with 192 bit bus and only 22 compute units.
the TDP is listed at 120 watts and recommend 300 power supply, but I had a 450-power supply withe the amd 480 and last year burn out.

Anyway this seems a good middle of the pack card for GPU computing. I have been waiting too long and they way things are, does not seem there will be a general solution to GPU computing, all I see is more brand-new pie on the sky specifications.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Opencl or Sycl

Postby Julio Jerez » Wed Feb 16, 2022 7:27 pm

I just got the video card and as usual the card only has one hdmi and three VidoPorts output
not DVI.
So I now have to get another adapter video port to hdmi and I will be all set for CUDA gpu stuff.

I now installed the card, the cuda sdk and the github sample.
the first drawback is that it seems they start at VS 2017 64bit.

I also seem a problem with nvidia driver, for some reason that do no support windows 32 bit debug open GL. I get crash, and across many computers and they all have in common nvidia hardware.
It seems nvidia is facing out 32 bit support. I guess that fine.

they compile say this
MSVC 2017 is deprecated but still supported. MSVC 2017 support will be removed in a future release.


with ton of other deprecated stuff, so sure it will even run with VS 2017.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 56 guests