Try resetting the SMU. If its a late 2004 model that involves unplugging the power cord and waiting 2 minutes. If its a early 2005 you will need to pull the outer access door, the plastic cover and the processor fan assy and press the logic board reset button only once.
Other than that it could be RAM, processor, video card, or logic board. Process of elimination says start with RAM. Pull the RAM and try it in different slots. Remember the RAM has to be seated in pairs in opposite slots. If same issue with RAM in different slots, try different matching pairs of RAM. Another thing to check is to see if it is one of the PM G5s with the liquid cooled processors. Those were known to spring leaks and for a while Apple was covering the replacement of any parts that were affected by the leak. Its been a little while since I ran into one of those, so I'm not sure that Apple is still covering those.
If non of the above apply try swapping video card with known good card. No change there, you may be looking at processor or logic board which is normally beyond the scope of anyone beyond a certified Apple shop to diagnose for you.