Concisely describe the proposed feature
Currently the LLVM backend (originally created by @yuanming-hu) is powerful yet often cause compatibility issue.
For example, I just got a strange segmentation fault when importing Taichi in Blender, whose stacktrace contains *llvm*...
In fact such situation is so often, that I just meet a CUDA RuntimeError when installing taichi on my father's computer willing to show off our works :rofl:
So I'd like to minimize the superior position of LLVM over other source-to-source backends (which has better compatibility in this binary perspective):
Describe the solution you'd like (if any)
Currently some nice backends I enjoy with:
ti.opengl explicitly.ti.cuda via @yuanming-hu's DynamicLoader.TI_WITH_METAL=OFF in CMake options.It would be great if we could do the same to all LLVM backends, including CPU, since C backend could replace it if needed:
ti.cpu or ti.cuda.TI_WITH_LLVM option in CMake, when set to OFF, to disable all LLVM backends including ti.cpu and ti.cuda.Additional comments
Add any other context or screenshots about the feature request here.
If here are something I can do, I would be glad to help!
@Rullec thank for the kindness. Do you have a developer setup for Taichi? I.e. build Taichi from source?
You'll need to add #ifdef TI_WITH_LLVM guards at correct positions, which is hard even to me. IMO such error-prone should be assigned to people who are familiar with the LLVM backend, e.g. @yuanming-hu. Not sure if a newscomer could resolve this task easily, sorry.
Thanks for your reply and please be no sorry! My standing point is quite simple: do something I can do.
But as you said, though I have the developer setup, It would be hard to me who is not familiar with the backend to handle it.
So do you have some other issue to recommend? I can work on them in my spare time, IMHO It's a lot of fun.
Thanks for proposing this!
I have to stress that the LLVM backends have been the most compatible backends and has the greatest portability. They will stay "superior" and will continue to serve as the default backends shipped with all Taichi releases in the foreseeable future.
Adding TI_WITH_LLVM is still helpful, but the main motivation to do that is to make it easier for some developers who happen to not need it. For example, maybe someone only wants to build WASM outputs, or he just wants to ship a pure Taichi shared object with only the Metal backend.
I probably won't have much time to do this in the near future, but if anyone with basic understanding of LLVM is interested in this, feel free to go ahead and implement! :-) Thanks in advance.
I have to stress that the LLVM backends have been the most compatible backends and has the greatest portability.
Not really. In fact, my first motivation for writing a OpenGL backend is that CUDA backend keeps throwing error message despite I have a NVIDIA card.. Do we have test for CUDA against old NVIDIA card? Not to say about #958..