-
Notifications
You must be signed in to change notification settings - Fork 841
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
Possibility of future migration to Vulkan API #77
Comments
Vulkan is not a compute API so DAIN can't use it at all. OpenCL is the alternative to CUDA. As for why DAIN's devs went for CUDA instead of OpenCL, maybe one of them will elaborate. Maybe AMD has gained a lot of ground lately but Nvidia still has a large marketshare lead over them in gaming PCs at least: https://store.steampowered.com/hwsurvey |
Vulkan is advertised as both Graphic and Compute API, |
Can we port it to vulkan ourselves? I really need this software for automated animation |
@Inhumanity96 @0xE1 Indeed, there is no reason for the Khronos group to release OpenCL 3 if Vulkan is an equivalent compute API and already available. In fact, that begs the question of why go for CUDA in the first place is OpenCL is already available and does what DAIN needs. |
Vulkan is/will be the most ubiquitous graphics API (save perharps yet for OpenGL) and is available by default on AMD, NVidia and Intel graphics drivers on Windows and Linux (plus possible over Apple's Metal via MoltenVK, available on newer versions of Android and even other systems), so from on-user-machine gaming perspective, porting this to Vulkan would make the most sense for single-source best availability. OpenCL on the other hand is not as easily available and is going through some rough patches. It can't be reasonably assumed as available for all end-users like Vulkan and it might be hard to ensure all needed features are always available for a broad target audience (more so now that OpenCL 3 specification was released reducing core functions). That being said, OpenCL over Vulkan exists so porting to OpenCL and shipping with the necessary compatibility layer might be enough. Also to consider, there are 3rd-party efforts to provide CUDA over Vulkan compatibility layers (eg: VUDA) and Nvidia is gradually making it more open, so likely soon there might be more development in that direction, thus possibly eliminating the need to actually port this (unless performance or licensing issues require it). references: |
Starting from CUDA the easiest path would be to convert to HIP that can export back to native CUDA and to OpenCL/AMD(ROCm) and perhaps that should eventually work in all Vulkan systems? https://rocmdocs.amd.com/en/latest/Programming_Guides/HIP-porting-guide.html#hip-porting-guide |
The in-development DAIN vulkan implementation |
this is an excelent development, @nihui! thanks for sharing it here!
Em ter, 25 de ago de 2020 12:50, nihui <notifications@github.com> escreveu:
… The in-development DAIN vulkan implementation
https://github.com/nihui/dain-ncnn-vulkan
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#77 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGS6JGDB4LCLWJ65MH252GTSCPMTRANCNFSM4NAV4RVA>
.
|
As I've repeatedly said, DAIN doesn't need a graphics API. It needs a compute API. If Vulkan doesn't provide the necessary compute functionality, it doesn't matter how popular it is or will be. And I highly doubt that it does. It makes no sense for the Khronos group to maintain two competing compute APIs so the most sensible conclusion that they are maintaining both OpenCL and Vulkan because each doesn't have the other's functionality.
Do you truly believe that it makes sense to run DAIN on Android phones and tablets, with significantly less power than PCs and servers?
I recommend re-reading Anandtech's writeup. OpenCL 3 does not have reduced core functionality. All of the functionality of previous versions are present. The only change in this regard is that the 2.x functions are now optional, for good reason as no one wanted to implement them when compulsory. Making them compulsory for 3 would have only repeated the problem.
OpenCL does not exist over Vulkan but alongside it.
Please re-read Phoronix's article. VUDA is not a compatibility layer. It is a library that allows devs that are writing Vulkan programs to write them in CUDA syntax. You still need to target the Vulkan API to make it work in the first place.
Good luck with your project but is using ncnn really a good idea? It appears to be a library whose target audience is mainly neural network apps on smartphones and tablets. The supported platform matrix section indicates that it's mainly designed to run on ARM CPUs whereas x86 CPUs and all GPUs are not optimised. Since Vulkan also only appears to be tacked on to accelerate select functions with most of the work done by the CPU, to say that it will make DAIN use Vulkan is stretching things. |
Beta prebuild binary is available via https://github.com/nihui/dain-ncnn-vulkan/actions ci artifact If you have any questions, you can send an issue on my project 😃 |
@nihui |
While CUDA is king in field of GPU Computations,
their licensing is very strict and expensive when used on non-workstation environment.
Any insight on possibility of migrating to Vulkan API for hardware agnosticism?
AMD Radeon have gained a lot of ground lately (and they have favorable licensing), and Intel is going to join the Dedicated GPU field in near future.
The text was updated successfully, but these errors were encountered: