By the classification theorem of cubic surfaces (p.6 in [this paper](https://arxiv.org/pdf/1305.0178.pdf)), a cubic surface belongs to the following classes 1. Has at worst ADE singularities. 2. Has an elliptic singularity, i.e., the surface is cone over a smooth cubic curve. 3. Non-normal or non-integral, and singular along a curve. So if $X$ has two singularities, $X$ belongs to case 1 and all singularities are rational. We can compute the cohomology by the minimal resolution $\tilde{X}\to X$. The surface $\tilde{X}$ is called a weak del Pezzo surface, which is still blowup of 6 points on $\mathbb P^2$, but in less general positions, so $H^{2}(\tilde{X})=\mathbb Z^7$. Now let's do some topology: Let $E$ be the exceptional divisor. Then the long exact sequence of the pair $(\tilde{X},E)$ reads $$H^1(E)\to H^2(X)\to H^2(\tilde{X})\xrightarrow{r} H^2(E),$$ where we used $H^*(\tilde{X},E)\cong H^*(X)$ because $\tilde{X}/E\cong X$ as CW complex. $E$ is the disjoint union of two bunches of rational curves over the two singularities, so $H^2(E)$ has rank $\mu_1+\mu_2$, where $\mu_i$ is the Milnor number of the singularity. Also, $H^1(E)=0$ and $r$ is surjective, so $$H^2(X)=\mathbb Z^{7-\mu_1-\mu_2}.$$ Cohomologies at other degrees are easy to compute.