We present an unbiased structure search for shape memory alloy NbRu using the particle swarm optimization algorithms combined with first-principle calculations. Based on our search, two experimentally observed cubic Pm3¯m and tetragonal P4/mmm structures are successfully reproduced under ambient pressure conditions. We confirmed the middle transition phase β” (orthorhombic or monoclinic) observed in experiment belongs to orthorhombic Pnma structure. By calculating the formation enthalpies under high pressure up to 100 GPa, it is found that tetragonal P4/mmm structure has potential for application under high pressure. Additionally, high-pressure phase transition is identified between cubic Pm3¯m structure and the orthorhombic Pnma structure at 50 GPa, above which, the orthorhombic Pnma phase is more energetically favorable. The analysis of density of states shows that all the studied NbRu structures exhibit metallic behavior and the d orbitals of both metal compositions Nb and Ru play important role.