code: def test_invalid_gpu_id(self):
      from sklearn.datasets import load_digits
  
      X, y = load_digits(return_X_y=True)
      # should pass with invalid gpu id
      cls1 = xgb.XGBClassifier(tree_method="gpu_hist", gpu_id=9999)
      cls1.fit(X, y)
      # should throw error with fail_on_invalid_gpu_id enabled
      cls2 = xgb.XGBClassifier(
          tree_method="gpu_hist",
          gpu_id=9999,
          fail_on_invalid_gpu_id=True,
      )
      with pytest.raises(ValueError, match="ordinal 9999 is invalid"):
          cls2.fit(X, y)
  
      cls2 = xgb.XGBClassifier(
          tree_method="hist",
          device="cuda:9999",
          fail_on_invalid_gpu_id=True,
      )
      with pytest.raises(ValueError, match="ordinal 9999 is invalid"):
          cls2.fit(X, y)
  
file_path: xgboost/tests/python-gpu/test_gpu_basic_models.py
imports: import os
  import sys
  import numpy
  import pytest
  import xgboost
  from xgboost import testing
  import test_basic_models
  import test_callback
label_desc: Use image node_id 6 for calling the TestGPUBasicModels obj's underlying member method code with example usage: obj.test_invalid_gpu_id() without return types