  A search for time-directional coincidences of ultra-high-energy (UHE) photons
above 10 EeV with gravitational wave (GW) events from the LIGO/Virgo runs O1 to
O3 is conducted with the Pierre Auger Observatory. Due to the distinctive
properties of photon interactions and to the background expected from hadronic
showers, a subset of the most interesting GW events is selected based on their
localization quality and distance. Time periods of 1000 s around and 1 day
after the GW events are analyzed. No coincidences are observed. Upper limits on
the UHE photon fluence from a GW event are derived that are typically at
$\sim$7 MeV cm$^{-2}$ (time period 1000~s) and $\sim$35 MeV cm$^{-2}$ (time
period 1 day). Due to the proximity of the binary neutron star merger GW170817,
the energy of the source transferred into UHE photons above 40 EeV is
constrained to be less than 20% of its total gravitational wave energy. These
are the first limits on UHE photons from GW sources.
