code: def test_cv_sparkxgb_classifier_feature_cols_with_gpu(
      spark_iris_dataset_feature_cols,
  ):
      from pyspark.ml.evaluation import (
          MulticlassClassificationEvaluator,
      )
  
      train_df, test_df, feature_names = spark_iris_dataset_feature_cols
  
      classifier = SparkXGBClassifier(
          features_col=feature_names,
          device="cuda",
          num_workers=num_workers,
      )
      grid = (
          ParamGridBuilder()
          .addGrid(classifier.max_depth, [6, 8])
          .build()
      )
      evaluator = MulticlassClassificationEvaluator(metricName="f1")
      cv = CrossValidator(
          estimator=classifier,
          evaluator=evaluator,
          estimatorParamMaps=grid,
          numFolds=3,
      )
      cvModel = cv.fit(train_df)
      pred_result_df = cvModel.transform(test_df)
      f1 = evaluator.evaluate(pred_result_df)
      assert f1 >= 0.97
  
      clf = SparkXGBClassifier(
          features_col=feature_names,
          use_gpu=True,
          num_workers=num_workers,
      )
      grid = ParamGridBuilder().addGrid(clf.max_depth, [6, 8]).build()
      evaluator = MulticlassClassificationEvaluator(metricName="f1")
      cv = CrossValidator(
          estimator=clf,
          evaluator=evaluator,
          estimatorParamMaps=grid,
          numFolds=3,
      )
      cvModel = cv.fit(train_df)
      pred_result_df = cvModel.transform(test_df)
      f1 = evaluator.evaluate(pred_result_df)
      assert f1 >= 0.97
  
imports: import json
  import logging
  import subprocess
  import numpy
  import pytest
  import sklearn
  from xgboost import testing
  from pyspark.ml.linalg import Vectors
  from pyspark.ml.tuning import CrossValidator, ParamGridBuilder
  from pyspark.sql import SparkSession
  from xgboost.spark import SparkXGBClassifier, SparkXGBRegressor, SparkXGBRegressorModel
label_desc: Use image node_id 9 for calling a global function with example usage: test_cv_sparkxgb_classifier_feature_cols_with_gpu(spark_iris_dataset_feature_cols) without return types