July 27 (Reuters) - U.S. House Speaker Nancy Pelosi's husband sold his shares of chipmaker Nvidia (NVDA.O) on Tuesday, days before the House is expected to consider legislation providing subsidies and tax credits worth over $70 billion to boost the U.S. semiconductor industry.

In a periodic transaction report, the senior Democrat disclosed that her husband, financier Paul Pelosi, sold 25,000 shares of Nvidia for about $4.1 million, ending up with a loss of $341,365.

Paul Pelosi frequently trades shares of companies popular with many investors, including Apple (AAPL.O), Microsoft (MSFT.O) and other tech companies.

Transaction reports filed by Pelosi, a multi-millionaire, show her husband bought 5,000 Nvidia shares in July 2021, and that he exercised options to buy another 20,000 Nvidia shares last June.

The Senate is expected to vote on final passage in coming days of legislation providing about $52 billion in government subsidies for U.S. semiconductor production, as well as an investment tax credit for chip plants estimated to be worth $24 billion.

The legislation, which aims to make the domestic chip industry more competitive with China's, would then be taken up in the U.S. House under Pelosi's direction.

Last year, Pelosi defended the rights of federal lawmakers to trade stocks, but she later responded to calls for a ban on trading by lawmakers by signaling willingness to potentially advance such legislation.

A 2012 law makes it illegal for lawmakers to use information from their work in Congress for their personal gain. The law requires them to disclose stock transactions by themselves or family members within 45 days.

An analysis by Unusual Whales, a service selling financial data, concluded that congressional lawmakers last year traded $290 million in stocks, options, cryptocurrency and other assets, and that they outperformed the market, on average.

Santa Clara, California-based Nvidia is most valuable U.S chipmaker.