Here is my code.
t0 = 1
t1 = 1
dvector[kx_, ky_, m_] := {t1*Sin[kx], t1*Sin[ky], t0*(Cos[kx] + Cos[ky] - m)}
dcap[kx_, ky_, m_] :=
dvector[kx, ky, m]/Sqrt[Dot[dvector[kx, ky, m], dvector[kx, ky, m]]]
f[kx_, ky_, m_] :=
Dot[dcap[kx, ky, m], (D[dcap[kx, ky, m], kx]\[Cross]D[dcap[kx, ky, m], ky])]
g[m_] := (NIntegrate[
f[kx, ky, m], {kx, 0, 2*π}, {ky, 0, 2*π}]/(4*π)) // Chop
g[0.5]
g[-1]
(**-- Next one is Very slow --**)
g[3]
Whenever the absolute value of the argument in $g$ is greater than 2, it takes too long to evaluate the answer (which is zero), and it also shows errors in the numerical integration.
How to fix this? I want to plot $g$ as a function of its argument, which is taking way too much time due to the slowness to evaluate $g$ when $|m|>2$.