Formally smooth vs. smooth

A (commutative) algebra $A$ is called formally smooth if for any (commutative) algebra $R$ and an ideal $I\subset R$ such that $I^2=0$, any morphism $A\to R/I$ lifts to a morphism $A\to R$.

Suppose now that $X$ is a variety and $A$ is the algebra of regular functions on it.

How are the definitions of formal smoothness of $A$ and smoothness of the variety $X$ related?

Are the two notions equivalent? It doesn't seem to be the case, but I don't know how to prove it. I might be very silly here. In this case I would be glad if you explain that to me.

Thank you very much!

-

You haven't introduced a base-ring for the various algebras in play; let me denote it by $A_0$. (In the case of varieties, we would take $A_0$ to be a field, but that doesn't affect anything.)
For a finitely presented $A_0$-algebra $A$, formal smoothness is equivalent to smoothness. (And if $A_0$ is Noetherian, e.g. a field, then f.p. is equivalent to finite type.)
In particular, for the affine ring of an affine variety, formal smoothness over the ground field $k$ is equivalent to the variety being smooth.