Detecting whether GPUs are available


pytorch and tensorflow offer capabilities to detect whether or not GPUs are available to train.
Does such a method exist for xgboost? I could not find one.

Thank you very much!

You’ll get an error if you select gpu_hist tree method and there is no GPU available.