If you insist that maths is not contingent then why do you insist that God has to be?
I think materialists would say that maths is contingent on matter
I don't see why maths would be contingent on matter. Maths is abstract.
As for God being contingent, well to start with God is largely undefined, so you have a problem of definition to start with. But if we run with a popular view that god is some sort of being but then go on to observe that 'god could not lift a rock that was too heavy for him to lift' then with this observation we are demonstrating that god is in fact contingent upon logic; an origin of all things would be contingent upon nothing.