Nvidia Corp. agreed to a licensing deal with artificial intelligence startup Groq, furthering its investments in companies connected to the AI boom.