pai icon indicating copy to clipboard operation
pai copied to clipboard

getJNIEnv: getGlobalJNIEnv failed

Open leonfg opened this issue 7 years ago • 2 comments

Organization Name: Information Science Academy of China Electronics Technology Group Corporation

Short summary about the issue/question: Run a job will got error in stderr:

Environment variable CLASSPATH not set!
getJNIEnv: getGlobalJNIEnv failed

Brief what process you are following: Same as summary.

Distributed deploy

How to reproduce it: Job Description:

{
  "jobName": "distribute_train_mninst",
  "image": "openpai/pai.example.tensorflow",
  "virtualCluster": "default",
  "taskRoles": [
    {
      "name": "ps_server",
      "taskNumber": 1,
      "cpuNumber": 2,
      "memoryMB": 32768,
      "gpuNumber": 0,
      "command": "cd code && python train.py --data_dir=$PAI_DATA_DIR --output_dir=$PAI_OUTPUT_DIR --num_gpus=0  --ps_hosts=$PAI_TASK_ROLE_ps_server_HOST_LIST --worker_hosts=$PAI_TASK_ROLE_worker_HOST_LIST --job_name=ps --task_index=$PAI_CURRENT_TASK_ROLE_CURRENT_TASK_INDEX --train_steps=8000"
    },
    {
      "name": "worker",
      "taskNumber": 9,
      "cpuNumber": 2,
      "memoryMB": 32768,
      "gpuNumber": 1,
      "command": "cd code && python train.py --data_dir=$PAI_DATA_DIR --output_dir=$PAI_OUTPUT_DIR --num_gpus=1 --ps_hosts=$PAI_TASK_ROLE_ps_server_HOST_LIST --worker_hosts=$PAI_TASK_ROLE_worker_HOST_LIST --job_name=worker --task_index=$PAI_CURRENT_TASK_ROLE_CURRENT_TASK_INDEX --train_steps=8000"
    }
  ],
  "dataDir": "$PAI_DEFAULT_FS_URI/test/train_mnist/data/",
  "outputDir": "$PAI_DEFAULT_FS_URI/test/train_mnist/output/",
  "codeDir": "$PAI_DEFAULT_FS_URI/test/train_mnist/code/"
}

OpenPAI Environment:

  • OpenPAI version: v0.13.0
  • Cloud provider or hardware configuration: Two Workers and one master
  • OS (e.g. from /etc/os-release): Ubuntu Server 16.04
  • Kernel (e.g. uname -a): Master: 4.4.0-142-generic Worker: 4.4.0-150-generic
  • Hardware (e.g. core number, memory size, storage size, GPU type etc.): Worker: Xeon 6130 * 2, 256G Memory, 2080TI * 8 Master: Xeon 5118 * 2, 256G Memory, No GPU
  • Others:

Anything else we need to know: This job is OK in previous PAI version like 0.12.0. It maybe a HDFS related problem, I tried several jobs with HDFS access which run well in 0.12 will got same error, others without HDFS access are OK in 0.13

leonfg avatar Jul 17 '19 00:07 leonfg

As a workaround, you can add export CLASSPATH="$(hadoop classpath --glob)" at the beginning of command, e.g. export CLASSPATH="$(hadoop classpath --glob)" && cd code && ....

abuccts avatar Jul 17 '19 08:07 abuccts

As a workaround, you can add export CLASSPATH="$(hadoop classpath --glob)" at the beginning of command, e.g. export CLASSPATH="$(hadoop classpath --glob)" && cd code && ....

It works, Thanks!

leonfg avatar Jul 17 '19 08:07 leonfg