How it works...

We need to enable a proper ND4J backend so that we can utilize GPU resources, as we mentioned in step 1. Enable the nd4j-cuda-x.x dependency in youpom.xml file for GPU training, where x.x refers to the CUDA version that you have installed. 

We may include both ND4J backends (CUDA/native dependencies) if the master node is running on the CPU and the worker nodes are running on the GPU, as we mentioned in the previous recipe. If both backends are present in the classpath, the CUDA backend will be tried out first. If it doesn't load for some reason, then the CPU backend (native) will be loaded. The priority can also be changed by changing the BACKEND_PRIORITY_CPU and BACKEND_PRIORITY_GPU environment variables in the master node. The backend will be picked depending on which one of these environment variables has the highest value.

In step 3, we added CPU-specific configuration that targets CPU-only hardware. We don't have to keep this configuration if both the master/worker nodes have GPU hardware in place. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset