I don't like using grain to produce biodiesel since it is not a good use of food or an efficient source of biodiesel. But it can be done if we have excess "food".
But algae farms instead of solar and wind farms make a lot of sense. To optimize biodiesel production, you locate them next to coal fired power plants and pump the CO2 exhaust through the water. You can even build algae farm "high rises" that produce massive amounts of algae in place grain farming does not work.
Final point on grain, I think too much grain is used as animal feed, which contributes to global warming. In contrast, animals that are grass fed and grass finished actually contribute to a net reduction in CO2 and given the price of grain fertilizer, it is competitive with grain fed beef and healthier (but because it has less fat, it does not have the heavy "white" fat flavor).
https://agronomag.com/the-economic-benefits-of-algae-farms/
https://www.nytimes.com/2011/10/27/business/energy-environment/farming-for-energy-starts-to-gain-ground.html