Every PCIe GPU can run in any generation PCIe, it doesn't matter, what matter is how much the GPU can utilize the bandwidth.
Every car can run on a 200mph highway, can it reach 200mph?
most x16 gpu can work in x8, it is physically limited by the slots, what determines the bandwidth is the CPU or Chipset.
It doesn't need to know which pcie version it is put on, as PCIe devices are version agnostic.
there is a slight increase when using version 4.0, 1% at most.