Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-10107

Invoking NMWebServices#getNMResourceInfo tries to execute gpu discovery binary even if auto discovery is turned off

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.3.0
    • 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.

      Attachments

        1. YARN-10107.001.patch
          8 kB
          Szilard Nemeth
        2. request-response-beforechange.txt
          0.4 kB
          Szilard Nemeth
        3. request-response-afterchange-with-autodiscovery.txt
          1.0 kB
          Szilard Nemeth
        4. request-response-afterchange.txt
          0.4 kB
          Szilard Nemeth
        5. nm-config-beforechange-gpu.xml.xml
          0.8 kB
          Szilard Nemeth
        6. nm-config-afterchange-gpu.xml
          0.5 kB
          Szilard Nemeth

        Issue Links

          Activity

            People

              snemeth Szilard Nemeth
              snemeth Szilard Nemeth
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: