In a different thread, someone indicated that analogWrite does not work on any of the DACs despite the documentation saying it should be possible (How to output constant DC voltage via onboard DAC's? - #8 by J-M-L). I also couldn't get analogWrite to work on a DAC on the Giga R1, so I ak using the Advanced Analog library instead.
As for the pinMode statement: Try omitting it. I don't see why it would be necessary on dedicated DAC pins. Trying to leave it out doesnt cost you anything at least.