Optiplex 5040 MT has Q170 chipset.  Best cpu is i7-6700.  No need to get a better 6700k because chipset does not let you OC. Dell spec max memory is 16 GB DDR3L 1600.  But you may add up to 32 GB with latest BIOS update. There is no absolute max gpu.  some of the gpu suggested to match i7-6700 (non-k) 1080p: GTX 1080/RTX 2070/Vega64 1440p/4k: no limit  
Hi, I was thinking of buying an Optiplex 5040 MT and I was wondering what the absolute maximum upgradeability is of the CPU, the GPU, and if needed, the PSU. ___ I'm editing this just to say that I am willing to upgrade the PSU to be able to put in better cards.
Maximum Upgradability of an Optiplex 5040 MT