They have best stuff now (and likely for a few years), but it's design for relatively predictable workloads with known best solutions.
Everyone sees the money nvidia makes and wants a piece of it (e.g. Jim Keller and hubdreds if others). Make something with lower TCO, proper integrations with pyrorch and co and B2B will buy.
Can't someone else just implement CUDA for their chips? I don't see that being worth trillions, it is hard but isn't that hard to replicate. Billions makes sense, not trillions.
Having a different API from CUDA is not the problem. Having working and performant product is the problem.
AMD made a nearly clone of CUDA API with HIP (the implementation is garbage btw). The API mostly changes prefix from "cuda" to "hip" and even has semi-automatic source code modifier tool to make the switch.
It's like any other software migration (e.g. from on-prem to cloud):
If ("money to switch library" < "savings per quarter" * quarters)
{
"Do the switch"
} else {
"Status quo"
}
Compared to a trillion dollars it is "just", it is just a software implementation moat, its a compiler it isn't on the scale of reimplementing windows or so.
Tesla is overvalued, but it's one stock. The AI stuff is pretty widespread and getting shoved into use cases where it may not make much economic sense. It could be like the .com bubble - where there's real market opportunity there, but some of the early ideas are too optimistic and can't be run profitably.