I failed to set options for PETSc compiled with CUDA

I have successfully compiled PETSc with CUDA and tested the official example petsc/src/ksp/ksp/tutorials/ex12 with the following command.

ex12 -n 200 -m 200 -pc_type none -vec_type cuda -mat_type aijcusparse

I can see the GPU memory allocated and the speeding up. Then, I compiled dolfin with this PETSc. However, when I tested demo poisson by adding the following codes:

PETScOptions.set("-mat_type", "aijcusparse");
PETScOptions.set("-vec_type", "cuda");

the GPU didn’t work. The program still ran on the CPU. Is any other options should be set to call the GPU API?