What year was the first motor race held that was classed as formula 1?

That would be in 1950. The first F1 race was the 1950 British GP.