install dlib gpu check

C++
dlib.DLIB_USE_CUDA

Source

Also in C++: