While Nvidia's (NVDA 6.18%) AI-fueled rally may not be over, it becomes increasingly difficult to justify buying the stock as the GPU maker's valuation soars. With a market capitalization of $2.2 trillion as of midday Wednesday, the stock requires investors to ignore the myriad threats that could unravel the company's dominance of the AI chip market.

The biggest advantage Nvidia has comes from software. CUDA is Nvidia's software toolkit for developing applications that can be accelerated by its GPUs. CUDA has been around for 16 years and has become the de facto standard. As the AI boom got underway, the path of least resistance was Nvidia GPUs and CUDA-powered software.

While there are alternatives to CUDA, there's a tremendous amount of inertia keeping Nvidia's dominance intact. Without this software advantage, competing AI chips from AMD, Intel, and others would be having an easier time winning market share.

Nvidia recently updated its end-user license agreement for CUDA to explicitly disallow translation layers that enable CUDA-based software to run on non-Nvidia hardware. The company is clearly worried about competition chipping away at its dominant market position. The end of CUDA's dominance would be a boon for any company that buys AI accelerators, and it's likely to happen sooner or later as AI companies seek alternatives.

A low-risk way to bet on AI

While Nvidia's competitive advantages will likely erode over time as competition heats up, International Business Machines (IBM -1.05%) is positioning itself to be the go-to platform for AI among large enterprises and organizations. The company's watsonx AI platform, which gets its name from the Watson AI supercomputer that won Jeopardy! in 2011, is aimed at the type of customers that can't throw caution to the wind as they adopt AI technology.

The watsonx platform enables enterprises to train, validate, and deploy AI models while keeping an eye on compliance, risk management, and governance issues. Companies that operate in highly regulated industries must follow strict rules regarding their data, and no company wants a customer-facing AI chatbot to go off the rails. IBM's watsonx platform provides guardrails for enterprises deploying AI.

Beyond general use cases, watsonx has some specific capabilities that can drive adoption. IBM's mainframe systems, which have been at the heart of some industries for decades, run billions of lines of sensitive, mission-critical code written in an ancient programming language called COBOL. As the number of developers capable of writing and maintaining COBOL code declines, IBM's mainframe customers are put in a bind.

This is where the watsonx Code Assistant comes into play. One application for this product is modernizing COBOL code by transforming it into Java code. This process must be done with care because much of this code is highly sensitive -- think software that processes transactions at major financial institutions. This functionality will not only drive customers to adopt the watsonx platform but also strengthen the mainframe business by making it much easier to modernize applications.

Still a bargain stock

IBM stock has rallied over the past year, gaining about 50% in that time. Optimism about the company's AI prospects along with a string of solid results are the likely culprits behind the surge.

Even as IBM stock closes in on its all-time high, the stock remains a great value for investors. The company expects to generate free cash flow of about $12 billion this year, which puts the price-to-free cash flow ratio at 15. For comparison, other large tech companies trade at significantly higher multiples of free cash flow.

IBM Price to Free Cash Flow Chart

IBM Price to Free Cash Flow data by YCharts

AI is just a piece of what IBM does, but it's likely to be a key growth driver in the years ahead. The stock isn't nearly as cheap as it once was, but it's still an attractive investment for those looking to tap into the AI boom without taking on excessive levels of risk.