Do you have to have knowledge to commit a venial sin?
Yes, some knowledge is necessary for a venial sin to be committed. The Catechism of the Catholic Church states:
One commits venial sin when, in a less serious matter, he does not observe the standard prescribed by the moral law, or when he disobeys the moral law in a grave matter, but without full knowledge or without complete consent (CCC 1862).
For the sin to be mortal, full knowledge is required:
For a sin to be mortal, three conditions must together be met: Mortal sin is sin whose object is grave matter and which is also committed with full knowledge and deliberate consent (CCC 1857).