Not the easiest way, but still a valid method to tackle problems like this. Use the tan-half-angle substitution
$$ \begin{align} x & = 2 \tan^{-1}(t) \\
\cos(x) & = \frac{1-t^2}{1+t^2} \\
\sin(x) & = \frac{2 t}{1+t^2} \end{align} $$
Also we need to expand the $\cos(n x)$ terms to make
$$ \cos(x) \left( 2 \cos^2(x)-1\right) \left(1-8 \sin^2(x) \cos^2(x) \right) = \frac{1}{8} $$
Now change the variables $x \rightarrow t$ for
$$ \left( \frac{1-t^2}{1+t^2} \right) \left( \frac{t^4-6 t^2+1}{(1+t^2)^2} \right) \left( \frac{t^8-38 t^6+70 t^4-28 t^2+1}{(1+t^2)^4} \right) = \frac{1}{8} $$
All this can be factored as
$$ \frac{(1-3 t^2)(3 t^{12}-90t^{10}+705 t^8-1660 t^6+1365 t^4-266 t^2+7)}{8(1+t^2)^7} = 0 $$
(thank you CAS)
This is an even function, are we are only concerned about positive roots. The first immediate root is $t=\frac{1}{\sqrt{3}}$, which is
$$ x_1 = 2 \tan^{-1} \left( \frac{1}{\sqrt{3}} \right) = 2 \frac{\pi}{6} =\frac{\pi}{3}$$
The other roots I got where
$$ \begin{align}
t_2 & = 0.176326980708464 & x_2 = 0.349065850398863 \\
t_3 & = 0.481574618807528 & x_3 = 0.897597901025654 \\
t_4 & = 1.1917535925942 & x_4 = 1.74532925199432\\
t_5 & = 1.2539603376627 & x_5 = 1.79519580205130 \\
t_6 & =2.74747741945462 & x_6 = 2.44346095279206 \\
t_7 & = 4.38128626753482 & x_7 = 2.69279370307696
\end{align}$$