Download, install, and set up the CUDA toolkit from https://developer.nvidia.com/cuda-downloads. OS-specific setup instructions are available at the NVIDIA CUDA official website.
Configure the GPU for Spark distributed training by adding a Maven dependency for ND4J's CUDA backend: