Artificial intelligence (AI) stocks have soared over the past two years, gaining in the double and even triple digits. Names like chip designer Nvidia and software player Palantir Technologies led the movement as they reported soaring demand for their offerings, and this equaled top earnings and stock price performance.

Though AI has been a growth driver for many tech players, certain companies have either lost momentum in more recent times or missed out on the initial stages of the AI boom. This doesn't mean they won't benefit from the AI growth story moving forward, though, as the market is expected to surpass the trillion-dollar mark by 2030. So, there's still time for companies to score an AI win.

With this in mind, let's consider Super Micro Computer (SMCI -4.26%), a company that once soared but hit a roadblock last year, and Intel (INTC -0.37%), a player that's lagged rivals in the AI space. Which is the better AI stock? Let's find out.

Two investors smile while looking at something on a computer in an office.

Image source: Getty Images.

The case for Super Micro Computer

Supermicro has been around for more than 30 years, but the company's growth truly took off in the early days of the AI boom. The tech player provides servers and full rack scale systems to data centers. Importantly, it includes the latest technologies -- for example, chips from AI leaders such as Nvidia or Advanced Micro Devices (AMD) -- in its systems. This helped revenue and stock performance climb.

But questions into the company's accounting practices then weighed heavily on share performance, and the stock fell more than 70% from its high in March of last year through the end of the year.

The accounting questions were resolved, though, putting the company back on track. But investors have been wary about piling into this stock in recent times. Concern about the economy ahead has hurt AI stocks in general, and investors also have been disappointed in Supermicro's shrinking gross margin -- it came in at less than 10% in the recent quarter versus 15% a year earlier. This isn't too alarming, though, as it's linked to higher inventory of older products and expenses to bring newer products to market.

It's also important to note that Supermicro benefits from a building-blocks technology that allows it to quickly assemble and deliver its equipment, tailored to a customer's needs. And the company's expertise in liquid-cooling technology could offer another growth driver as customers look for ways to address the challenge of heat buildup in AI data centers.

The case for Intel

Intel is a leading maker of central processing units (CPUs), the main processor in a given computer. But the company fell behind in the high-growth area of AI as Nvida and AMD charged ahead. Intel has since developed its own AI chips, but it's struggled to generate significant growth. The company's plan to become a leading foundry has so far represented a weight rather than a growth driver.

Still, Intel could be at an important turning point right now. The company named Lip-Bu Tan -- who led Cadence Design Systems to soaring revenue and stock performance in recent years -- as new chief executive officer in March. Tan started off by announcing he would further cut costs and streamline processes so that ideas can turn into products more quickly, and invest in engineering and innovation. This will take time, as Tan said, so investors may have to be patient -- results of this sort of effort might take a while to emerge.

Tan also has expressed commitment to the foundry business, with an emphasis on being able to address the needs of each customer. This, too, may weigh on Intel in the near term, but if Tan's plans work out, the foundry could be a massive growth driver for the company down the road.

Should you buy Supermicro or Intel?

If Supermicro successfully manages its inventory and production, it could continue to greatly benefit throughout the AI revolution. And if Tan is able to reach even some of his goals, Intel may find itself among AI winners later in this AI growth story.

But it's important to remember that risk remains for these players after their recent troubles. So I would only recommend getting in on both or one of them if you're a growth investor who doesn't mind risk and volatility. And in this case, if I had to choose one, I would go for Supermicro. The stock is reasonably priced at 22x forward earnings estimates and could immediately benefit from AI build-out demand in the quarters to come. As for Intel, investors may want to watch a couple more quarterly reports to learn more about Tan's strategy -- and look for potential signs of success.