Depends.
Number one: caves and mud hovels (sedentary) are not nomads (mobile). Pick your poison for caveman lifestyle.
300,000 cavemen - cannot all eat from local resources (especially given their low technology level) - without a baggage train, herds of horses/cattle (to kill and consume) - they're going to be unable to bring all their manpower to bear on their enemies.
What types of defenses do wizards have, and can their magic generate and/or protect their food/water supply?
eg: If wizards grow corn or grain, it will just take a couple nice stampedes or some fire-arrows to put paid to a year's worth of crops. Unless wizards are very well prepared, they're not going to survive two years of this.
Cavemen have used fire to hunt / drive herds of animals since time immemorial. If not fire-arrows, then brands/torches.
If wizards hunt, cavemen just need to keep their cattle / horses far enough away and scare off/kill all the game in the area (wizards are going to have a tough time feeding 3k people on game from a local area - even with guns). Cavemen will have to hope that they can keep the wizards from collecting enough of their bodies to go cannibal. 121
Nerve poison (poison frogs?) or other nasty biologicals would help.
Cavemen need to harass enough to prevent work parties of wizards from putting up walls. It would help if cavemen got better bows (longbows), and better yet if they had trebuchets.
But wizards probably don't have enough man-power to man walls for all their fields. Cavemen just need to rush walls, throw up sandbags and dig/bash thru to set fire to crops (or fire arrow over the walls).
Cavemen are going to have to learn to dig earthworks to protect themselves from direct fire (guns), and bombs/artillery. Cavemen need to learn about guns quick, and realize they need something between them and wizards.
Are magicians' artillery far more accurate than WW1/ww2 artillery? ie: on par with 21st century smart weapons?
If not, cavemen just getting their trenches or raids close enough to the fields will result in short rounds taking out the wizards' food supply (or walls) by friendly fire.
Cavemen should target the water supply - if it's wells: throw some dead animals in there, or some poison - and they'll put a world of hurt on wizards. Especially if it's a sneak attack. If they've infiltrated the surrounding area, they'll make the wizards have to bring the fight to them, and can be entrenched.
If cavemen can restrict water (use that manpower to fill in streams / rivers), they can kill off the wizards' crops. 523