If you look back at the dot com era, hardware companies did survive but weren't the financial "winners". Cisco is an example and a good comparison is Amazon - their bread and butter now is ecommerce, they dominate it and that was borne out of that bubble.
Alphabet also has massive market share with YouTube, solid cloud offerings, Waymo which already has driverless/unsupervised robot taxis and their old standby search which is morphing more into more AI answers when you throw questions in your browser.
Alphabet's P/E ratio is lower than the S&P 500's. Some may argue the S&P is mostly being held up by Tech and AI related companies so stock in Alphabet could be seen as undervalued and NVDIA as overvalued.
Hardware almost always ends up getting commoditized so investing in hardware companies for the long haul does carry maybe more risk than mainly software companies.