In patients with HIV, cancer incidence trends from 2001 to 2019 differed by transmission risk and were not uniform across racial and ethnic groups.