Page 1 of 1

CUDA vs OpenCL efficiency on Kepler

Posted: Thu Apr 17, 2025 8:03 am
by arisu
I have an old system with a GTX 770M that's gathering dust. It's still supported by FAH (just barely), but FAH uses a version of CUDA that it does not support, so it has to fall back to OpenCL.

How much efficiency loss is there? And is it a loss in utilization efficiency (more CUDA cores will be idle due to bad resource allocation) or in power efficiency (more power is used to get the same amount of work done)?

Re: CUDA vs OpenCL efficiency on Kepler

Posted: Thu Apr 17, 2025 9:50 am
by muziqaz
Asking very interesting question no one can answer anymore 😆

Re: CUDA vs OpenCL efficiency on Kepler

Posted: Thu Apr 17, 2025 10:16 am
by arisu
It looks like the first part of my question is answered in https://foldingathome.org/2020/09/28/fo ... a-support/ (probably 20-40% for my card). For the second part, I guess I'll find out soon when I measure power usage!

Re: CUDA vs OpenCL efficiency on Kepler

Posted: Thu Apr 17, 2025 3:54 pm
by DarkFoss
I remember the day of that announcement and the results. I'm hoping Hip provides a similar boost on the AMD side.

Re: CUDA vs OpenCL efficiency on Kepler

Posted: Thu Apr 17, 2025 4:04 pm
by muziqaz
DarkFoss wrote: ↑Thu Apr 17, 2025 3:54 pm I remember the day of that announcement and the results. I'm hoping Hip provides a similar boost on the AMD side.
Early tests show AMD is gaining much more than Nvidia. But Nvidia opencl was stronger in the beginning

Re: CUDA vs OpenCL efficiency on Kepler

Posted: Thu Apr 17, 2025 5:06 pm
by Joe_H
Nvidia pretty much stuck at OpenCL 1.2 until they recently decided to support a higher version. AMD had gone to OpenCL 2+ but the F@h code was written for the 1.2 lowest common denominator. So any optimizations for 2 weren't used.

Re: CUDA vs OpenCL efficiency on Kepler

Posted: Thu Apr 17, 2025 5:26 pm
by muziqaz
At the time of CUDA move, Nvidia opencl was much better than AMD.
We've done a comparison of Nvidia opencl>CUDA speed up Vs and hip speed up and AMD had much higher speed up

Re: CUDA vs OpenCL efficiency on Kepler

Posted: Thu Apr 17, 2025 7:27 pm
by DarkFoss
Great news something to look forward too. Thank you!

I read at Phoronix that Mesa finally retired Clover with the latest 25.x .Rusticl is either ready or soon will be the default OpenCL for older cards such as in arisu's case. Is fahbench's core 21 still viable as a performance test?
As in cards that meet a certain speed when run with specific flags such as nan check enabled run and run for the max 10. Those cards could then be white listed.
Phoronix test suite provides fahbench so it would just be a matter of asking the users to run a test profile that should be easy enough to create.
If Core 21 is too old perhaps provide a custom work folder containing some newer cores.

Re: CUDA vs OpenCL efficiency on Kepler

Posted: Fri Apr 18, 2025 11:36 am
by arisu
My 12yo GTX 770M is doing better than I expected. It's getting 100-200k PPD, although that might just be because it's folding those alchemiscale WUs.

As expected, it's not able to use CUDA (11.4) so it falls back to OpenCL (470.256). Which leads me to finding another bug in the v8 client. Even when CUDA is disabled (lufah config cuda false), the client advertises to the server that it supports it. In GPUResource.cpp, it shouldn't just be checking has("cuda"), it should verify that getConfig().isCUDAEnabled() is true as well before it does sink.insert("cuda", *get("cuda")). But that's just an aside. I'll report it on GitHub eventually but it's not a very serious bug so long as the assignment servers don't distinguish between CUDA and OpenCL support when choosing what WUs or cores to send out.

I guess this laptop still has some life in it. And as I write this, P12600 R380 C0 G0 has 5 seconds left before being finished.