Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
During internal end-to-end testing, I found the following issue:
Configuration:
- GPU is enabled
- yarn.nodemanager.resource-plugins.gpu.path-to-discovery-executables is set to "/usr/bin/ls" - Any existing valid binary file
- yarn.nodemanager.resource-plugins.gpu.allowed-gpu-devices is set to "0:0,1:1,2:2", so auto-discovery is turned off.
If REST endpoint http://quasar-tsjqpq-3.vpc.cloudera.com:8042/ws/v1/node/resources/yarn.io%2Fgpu is called, the following exception is thrown in NM:
2020-01-23 07:55:24,803 ERROR org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.gpu.GpuResourcePlugin: Failed to find GPU discovery executable, please double check yarn.nodemanager.resource-plugins.gpu.path-to-discovery-executables setting. org.apache.hadoop.yarn.exceptions.YarnException: Failed to find GPU discovery executable, please double check yarn.nodemanager.resource-plugins.gpu.path-to-discovery-executables setting. at org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.gpu.NvidiaBinaryHelper.getGpuDeviceInformation(NvidiaBinaryHelper.java:54) at org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.gpu.GpuDiscoverer.getGpuDeviceInformation(GpuDiscoverer.java:125) at org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.gpu.GpuResourcePlugin.getNMResourceInfo(GpuResourcePlugin.java:104) at org.apache.hadoop.yarn.server.nodemanager.webapp.NMWebServices.getNMResourceInfo(NMWebServices.java:515)
Let's break this down:
1. org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.gpu.GpuResourcePlugin#getNMResourceInfo just calls to the
gpuDeviceInformation = gpuDiscoverer.getGpuDeviceInformation();
2. In org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.gpu.GpuDiscoverer#getGpuDeviceInformation, the following calls to the NvidiaBinaryHelper.getGpuDeviceInformation:
try { lastDiscoveredGpuInformation = nvidiaBinaryHelper.getGpuDeviceInformation(pathOfGpuBinary); } catch (IOException e) {
3. org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.gpu.NvidiaBinaryHelper#getGpuDeviceInformation finally throws the exception.
This is only happens in case of the parameter called "pathOfGpuBinary" is null.
Since this method is only called from GpuDiscoverer#getGpuDeviceInformation, that passes it's field called "pathOfGpuBinary" as the only one parameter, we can be sure if this field is null, then we have the exception.
4. The only method that can set the "pathOfGpuBinary" fields is with this call chain:
GpuDiscoverer.lookUpAutoDiscoveryBinary(Configuration) (org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.gpu) GpuDiscoverer.initialize(Configuration, NvidiaBinaryHelper) (org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.gpu)
5. GpuDiscoverer#initialize contains this code:
if (isAutoDiscoveryEnabled()) {
numOfErrorExecutionSinceLastSucceed = 0;
lookUpAutoDiscoveryBinary(config);
....
, so org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.gpu.GpuDiscoverer#pathOfGpuBinary is set ONLY IF auto discovery is enabled.
Since our tests don't have auto discovery enabled, we have this exception. In this sense, the exception message is very misleading for me:
Failed to find GPU discovery executable, please double check yarn.nodemanager.resource-plugins.gpu.path-to-discovery-executables setting.
Related jira: https://issues.apache.org/jira/browse/YARN-9337
I think this exception message is very misleading and of course, it does not make any sense at all to try to execute the discovery binary.