Artificial intelligence (AI) has become the hottest investment theme, captivating the minds of both seasoned investors and newbies alike. This is not surprising, considering multiple research firms expect the AI market to be worth more than $1 trillion by 2030.

With the AI trend having the potential to generate windfall returns, investor interest in AI stocks is at an all-time high. Two stocks, namely Nvidia (NVDA 6.18%) and Marvell Technology (MRVL 3.17%), can prove to be compelling additions to any AI-focused stock portfolio. Here's why these stocks are smart picks now.

1. Nvidia

Widely known as the poster child of the ongoing AI revolution, semiconductor giant Nvidia is making history in front of our eyes.

Nvidia has posted impressive results in the fourth quarter of fiscal 2024 (ending Jan. 28, 2024), with both revenue and earnings surpassing consensus estimates. This is an impressive performance, especially since the U.S. government's rising restrictions on chip exports to China may force Nvidia to cancel billions of dollars of chip orders in 2024. Nvidia is also battling competition from other chip players such as Advanced Micro Devices and Intel, as well as from its key clients who are developing their proprietary AI chips.

Despite this, the technological superiority of Nvidia's AI chips has enabled it to capture nearly 92% share in the global data center GPU market. The company's state-of-the-art GPUs (A100 and H100 chips) and advanced networking technologies (which include the InfiniBand solutions used in high-performance AI infrastructures and the recently launched Spectrum-X end-to-end ethernet-based solution for AI-optimized networking) are being used extensively by data centers transitioning their trillion-dollar installed bases from general-purpose computing to accelerated computing. Furthermore, enterprises across industries are also leveraging generative AI technologies across use cases, which can also present a trillion-dollar opportunity for Nvidia's AI-optimized hardware offerings. Plus, the demand for Nvidia's chips is far outpacing supply, which has allowed the company to enjoy significant pricing power -- a key factor driving its solid data center revenue in the past few quarters.

Besides hardware, Nvidia's CUDA (Compute Unified Device Architecture) programming software stack has been helping clients to optimally program its GPUs for accelerated computing applications. With the increasing adoption of accelerated computing, enterprises also need support to maintain the complex software infrastructure. Since the companies do not have large engineering teams, Nvidia considers this to be a large opportunity for its Nvidia AI Enterprise cloud-native software platform.

While Nvidia's growth potential may seem solid, investors are rightly concerned about its sky-high valuation. Trading at 77 times its earnings, Nvidia can be considered to be a very expensive stock. However, this valuation is still cheaper than the company's three-year average price-to-earnings (P/E) multiple of 95.9 and five-year average P/E multiple of 86.9. Thanks to its cutting-edge offerings, Nvidia has always traded at a solid premium. Yet, it has delivered a mind-boggling 300% return in the past year.

Hence, with multiple robust tailwinds and a lower-than-historical valuation, it makes sense to start accumulating a position in this stock. Investors can also opt for a dollar-cost-averaging strategy and invest their money over a longer time, to control their risk.

2. Marvell Technology

Shares of fabless semiconductor player Marvell Technology dropped nearly 11.4% in a single day after the company released its latest earnings results (Q4 of fiscal 2024 ending Feb. 3, 2024) on March 7. Despite significant weaknesses in other end markets such as carrier infrastructure, enterprise networking, and the consumer market, the AI-driven data center business continues to be a bright spot.

Marvell has been investing aggressively in AI-optimized networking products and chips to benefit from the explosive growth in AI and accelerated computing markets. The company saw solid demand for its high-speed optical interconnect products (100 gig per lane 800 gig PAM products used to move huge amounts of data between chips), accelerators, and switches in traditional cloud data centers and AI-optimized data centers, in the fourth quarter. AI accounted for 10% of the company's data center revenue in fiscal 2024. Marvell expects to deploy its even faster optical interconnect products (200 gig per lane 1.6T PAM solutions) by the end of 2024.

Marvell has also recently announced an extension of its long-standing partnership with Taiwan Semiconductor Manufacturing for developing a technology platform capable of producing 2-nanometer chips for accelerated computing. This deal will enable the company to play a pivotal role in improving performance and power efficiency for next-generation AI workloads.

Besides AI, there is also solid growth potential in Marvell's other business segments. While currently in a cyclical downturn, Marvell expects its carrier infrastructure, enterprise networking, and consumer segments to recover gradually in the second half of fiscal 2025. Increasing connectivity and bandwidth requirements in vehicles is also proving to be a major growth driver for the company's automotive business.

Considering the increasing demand for its AI-optimized networking products and anticipated recovery in other end markets shortly, starting a position in this stock may be a smart move in 2024.