Using the color dipole formalism we study the production of direct photons in proton-nucleus and nucleus-nucleus collisions at energies corresponding to RHIC and LHC experiments. Prompt photons produced in a hard reaction are not accompanied with any final state interaction, either energy loss or absorption. Therefore, in the RHIC en- ergy range besides small isotopic corrections one should not expect any nuclear e ects at large pT . However, data from the PHENIX experiment indicates a significant large-pT suppression in d+Au and central Au+Au collisions that cannot be accompanied by coher- ent phenomena. We demonstrate that such an unexpected result is subject to the energy sharing problem universally induced by multiple initial state interactions (ISI) at large pT and/or at forward rapidities. In the LHC kinematic region ISI corrections are irrelevant at mid rapidities but cause rather strong suppression at forward rapidities. We present for the first time predictions for expected nuclear e ects at large pT in p + Pb and Pb + Pb collisions at di erent rapidities. We include and analyze also a contribution of coher- ent e ects associated with gluon shadowing modifying nuclear e ects predominantly at small and medium-high pT .