Nvidia disclosed on Friday that its stake in Elon Musk's SpaceX was worth about $21 billion at the end of the second quarter.

The chipmaker said in a filing with the Securities and Exchange Commission that it owns 122.8 million Class A shares in Elon Musk's rocket maker, which held its public market debut in June.

SpaceX's stock closed at $140 on Friday, down from $170.86 at the end of June, so the value of Nvidia's shares have declined to about $17.2 billion.

It's Nvidia's second biggest holding behind its stake in Intel, which is currently worth about $22 billion, down from $30 billion when the quarter ended. That represents a massive return on Nvidia's $5 billion investment less than a year ago.

Nvidia is the sixth biggest investor in SpaceX, based on data from FactSet. Musk is by far the largest owner with a stake worth about $850 billion. Alphabet is second at roughly $78 billion.

Nvidia's shares in SpaceX came from the company's $10 billion investment in Musk's xAI as part of a $20 billion round in January, according to a person familiar with knowledge of the matter who asked not to be named because the exact size of the deal wasn't made public. SpaceX acquired xAI in February in a deal valued at $1.25 trillion.

Musk said on SpaceX's second-quarter earnings call earlier this month that the company will exclusively use Nvidia chips in its AI data centers. He said Nvidia's graphics processing units have the "best architecture" for training and inference of AI models, and related products and services.

Musk also said, on the call that he expects SpaceX will receive a "significant allocation" of Nvidia's Vera Rubin GPUs next year.