Solution (source code)

= Solution

Choose an <ample divisor> $A$. The <Hodge index theorem for algebraic surfaces> implies $D\cdot A>0$: if it were zero, $D^2=0$ would force the <numerical class> of $D$ to be zero. Consequently $-D$ cannot be effective, because every nonzero <effective divisor> has positive intersection with $A$, while $-D\cdot A<0$.

The <Riemann–Roch theorem for algebraic surfaces> and the preceding computation give $\chi(X,\mathcal O_X(D))=2+D^2/2=2$. By <Serre duality>, $h^2(X,D)=h^0(X,-D)=0$. Thus
$$
\boxed{h^0(X,D)=2+h^1(X,D)\geq2.}
$$