NVIDIA drivers have version number such as 450 and this table shows which drivers are compatible to the CUDA toolkit version.
However, if your driver is too old you code should not execute at all.
EDIT: given you are using a 1050Ti with 4GB I guess you might be running out of memory by creating the additional unused module and the CUBLAS error is raised wrongly (as was reported in the past also).