Nvidia Corp. plans to invest $1 billion over five years in a new laboratory with Eli Lilly & Co., aiming to speed up the use of artificial intelligence in the pharmaceutical industry.