Nvidia co-founder and CEO Jensen Huang attends an event during the annual Computex computer exhibition in Taipei, Taiwan May 30, 2017.

Nvidia's dominant positions in the artificial intelligence and gaming markets are unmatched, according to Morgan Stanley.

The bank raised its rating for Nvidia's shares to overweight from equal-weight, predicting the chipmaker will report profits above expectations in its fiscal 2019.

"In addition to longer-term data investment trends, we see shorter-term drivers in gaming offsetting crypto weakness, and progress in data center inference [machine learning] expanding the long-term opportunity," analyst Joseph Moore wrote in a note to clients.

Moore reiterated his $258 price target for Nvidia shares, representing 20 percent upside from Monday's close.

The analyst estimates Nvidia will generate fiscal 2019 earnings per share of $6.76 versus the Wall Street consensus of $6.27.

Nvidia shares are up 120 percent over the past 12 months through Monday compared with the S&P 500's 11 percent gain.

"We now believe that developments in hardware and software have positioned NVIDIA to capture a higher portion of Inference, key to the long term growth rate," he wrote. "Strength in gaming titles, and a new NVIDIA product cycle, should drive growth while minimizing the negative impact of cryptocurrency mining economics moving to zero."

The company's stock closed up 5.8 percent Tuesday, ending at $227.91.

— CNBC's Michael Bloom contributed to this story.