![]() |
|
|
#1 |
|
"mrh"
Oct 2018
Temecula, ca
24·32 Posts |
I've been trying out coding up a few simple things using Vulkan compute shaders, instead of OpenCL. It seems pretty cool so far.
I was thinking of taking a shot at converting mfakt[oc] into a vulkan mfaktv. It would be fun to compare performance. Has anyone already tried something like this? Is it a dumb idea? |
|
|
|
|
|
#2 |
|
"Composite as Heck"
Oct 2017
11101101102 Posts |
Last time I looked it seemed hard to do generic compute with vulkan because vulkan is so focused on rendering, but that might have changed and I have little experience to be a good judge. It's worth exploring especially if you've had success implementing more trivial but definitely non-render-type compute in vulkan already. It might be much harder than OpenCL to get running performantly on different hardware types, and there might not be much to gain besides compatibility and maybe less overhead, but AFAIK no one has seriously tried and these are just my assumptions.
If you've found good resources on doing generic compute on vulkan please post them here, it's an interesting rabbit hole to learn about. |
|
|
|
|
|
#3 | |
|
"mrh"
Oct 2018
Temecula, ca
2208 Posts |
Quote:
I was able to build and run just by installing a few packages from the standard ubuntu distro. I'll keep digging into it and see what happens. thanks! Last fiddled with by mrh on 2023-03-10 at 16:15 |
|
|
|
|
|
|
#4 |
|
"mrh"
Oct 2018
Temecula, ca
24×32 Posts |
So I changed by path a bit. I've started converting gpuowl.cl into GLSL that compiles to SPIR-V to be used as a vulkan compute shader. I'm testing little bits as I go. Learning a lot about gpuowl and vulkan as I go. Fun! The bit-wise manipulations of floats/doubles had me stuck for a bit, but I figured out how to make those work well now.
|
|
|
|
|
|
#5 |
|
Jul 2009
Germany
2·353 Posts |
seems to be a lot of work but useful, respect!
|
|
|
|
|
|
#6 |
|
"Composite as Heck"
Oct 2017
95010 Posts |
Have you looked into this or something like it? https://github.com/google/clspv
No idea how far along that project is and it probably isn't as simple as press a button to transpile,but with luck it may be able to do some legwork. |
|
|
|
|
|
#7 | |
|
"mrh"
Oct 2018
Temecula, ca
24×32 Posts |
Quote:
|
|
|
|
|
|
|
#8 |
|
"mrh"
Oct 2018
Temecula, ca
100100002 Posts |
I had a little spare time so I wrote a very simple trial factor implementation as a Vulkan shader. It implements simple 96 or 128-bit integer math. It doesn't yet do any fancy montgomery, barrett, etc optimizations. I wanted to make sure I understood enough to make a working TF first.
On a Radeon VII it can test > 100M k-values/sec, so not mfakt[co] speeds, but still interesting. Shader code is here: https://github.com/mrh42/vtf/blob/main/tf.comp |
|
|
|
|
|
#9 |
|
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest
24·3·163 Posts |
Kudos! How did you choose a value for NK? What GPU utilization do you see in GPU-Z or similar, vs cpu utilization of the process in Task Manager (Win) / top (Linux)?
Code:
const int ntestprimes = 160; // tweak as needed Last fiddled with by kriesel on 2023-04-25 at 15:00 |
|
|
|
|
|
#10 | |
|
"mrh"
Oct 2018
Temecula, ca
24·32 Posts |
Quote:
The cpu does basically nothing, mapping/unmapping memory, checking on 64bit result and setting K for the next round. The vulkan calls don't seem to need any overhead that I can see. It will max out my gpu at 250W if I let it go at 2200Mhz. (On linux) You are correct, as it is now the sieve lets about 12% through. It should do better if it takes it down to around 8%, I think. But it doesn't at the moment. That function needs a little work to make it more pipelined, maybe. Now, if someone had a fft/ntt based Square-mod function I could use... :) Last fiddled with by mrh on 2023-04-25 at 15:29 |
|
|
|
|
|
|
#11 |
|
"mrh"
Oct 2018
Temecula, ca
14410 Posts |
With a few optimizations, it can test about 420M factors/second, or about 15 ghz-days/day (I think). Pretty good considering the really slow/simple squaring algorithm.
|
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How does this compute | tServo | PARI/GP | 3 | 2019-06-22 14:48 |
| New GPU Compute System | airsquirrels | GPU Computing | 90 | 2017-12-08 00:13 |
| Vulkan | CuriousKit | GPU Computing | 5 | 2016-02-25 14:00 |
| New Compute Box | Christenson | Hardware | 0 | 2011-01-15 04:44 |
| My throughput does not compute... | petrw1 | Hardware | 9 | 2007-08-13 14:38 |