In order to search for the magnetic ground state of surface nanostructures we extended first principles adiabatic spin dynamics to the case of fully relativistic electron scattering. Our method relies on a constrained density functional theory whereby the evolution of the orientations of the spin-moments results from a semi-classical Landau-Lifshitz equation. This approach is applied to a study of the ground state of a finite Co chain placed along a step edge of a Pt(111) surface. As far as the ground state spin orientation is concerned we obtain excellent agreement with the experiment. Furthermore we observe noncollinearity of the atom-resolved spin and orbital moments. In terms of magnetic force theorem calculations we also demonstrate how a reduction of symmetry leads to the existence of canted magnetic states.