June 5 (Reuters) - Shares of Nvidia rallied to record highs on Wednesday, with the AI chipmaker's stock market valuation on the verge of hitting the $3 trillion mark and overtaking Apple to become the world's second most valuable company.

The latest rally in Nvidia comes as it prepares to split its stock ten-for-one, effective on June 7, a move that could increase its appeal to individual investors.

Nvidia's stock has surged 145% so far in 2024, with demand for its top-of-the-line processors far outstripping supply as Microsoft, Meta Platforms and Google-owner Alphabet race to build out their AI computing capabilities and dominate the emerging technology.

The Silicon Valley chipmaker's stock was last up 4.2% at $1,212.89, giving Nvidia a stock market value of $2.98 trillion.

Apple's market capitalization stood at $3.01 trillion as its stock climbed 1.2%.

Microsoft remained the world's most valuable company, with a market value of $3.14 trillion as its shares climbed 1.6%.

(Reporting by Noel Randewich, Editing by Nick Zieminski)