The auto-startup program is stuck in Linux

I would like to ask you, there is no problem when my program is run manually, but after I set the boot auto-start in the script (sudo gedit /etc/rc.local), I found that the program is stuck in this position after boot running:

cublasHandle_t handle1;
cublasCreate(&handle1);

The latter one can’t run.,I think it should be a setting problem of boot auto-start.,Is there any way to solve it.