AMD and Intel together have more revenue than Nvidia, even without considering any other player in the industry or any community contributions they get from being open source.
Profit is revenue minus costs. Investment is costs. If you're reinvesting everything you take in your current-year profit would be zero because you're making large investments in the future.