diff --git a/downloader/other_resources.json b/downloader/other_resources.json index e5cf0094068a07c2a937a2488727f77fdbabb3b3..56d676a09fcc28f94ad3e9e1bcdb88780b0d1f30 100644 --- a/downloader/other_resources.json +++ b/downloader/other_resources.json @@ -73,5 +73,15 @@ "filename":"isl-0.16.1.tar.bz2", "url":"https://gcc.gnu.org/pub/gcc/infrastructure/isl-0.16.1.tar.bz2", "dest":"resources/" + }, + { + "filename":"apex-0.1+ascend-cp37-cp37m-linux_x86_64.whl", + "url":"https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/turing/resource/PTAdapter/V100R020C10/apex-0.1%2Bascend-cp37-cp37m-linux_x86_64.whl", + "dest":"resources/x86_64" + }, + { + "filename":"apex-0.1+ascend-cp37-cp37m-linux_aarch64.whl", + "url":"https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/turing/resource/PTAdapter/V100R020C10/apex-0.1%2Bascend-cp37-cp37m-linux_aarch64.whl", + "dest":"resources/aarch64" } ] diff --git a/playbooks/install_tensorflow.yml b/playbooks/install_tensorflow.yml index 22715e13c595fa7a1bb1cfa664726f6857eecde1..1959ae71582d6685d695900265e933ea22ecd14c 100644 --- a/playbooks/install_tensorflow.yml +++ b/playbooks/install_tensorflow.yml @@ -9,6 +9,18 @@ changed_when: false register: import_tensorflow + - name: stat gcc-7.3.0 + stat: + path: /usr/local/gcc7.3.0 + register: gcc_stat + + - name: install gcc 7.3 for centos 7.6 if not exist + import_tasks: task_gcc.yml + when: + - not gcc_stat.stat.exists + - "os_version == '7.6'" + - import_tensorflow.rc != 0 + - name: install tensorflow if import failed include_tasks: task_tensorflow.yml when: import_tensorflow.rc != 0 diff --git a/playbooks/task_gcc.yml b/playbooks/task_gcc.yml index 2f64f42b6be3164de17f383cd53861c6acba4931..25a8148567b8affadd5074ee7b6b507509ae57d5 100644 --- a/playbooks/task_gcc.yml +++ b/playbooks/task_gcc.yml @@ -63,6 +63,3 @@ - name: make install shell: make -C ~/build/gcc-7.3.0 install when: "'0' in cxx.stdout" - register: install_result - -- debug: var=install_result diff --git a/playbooks/task_torch.yml b/playbooks/task_torch.yml index 3a4d7256638be426c9d3dabaafab7bfc3348ba17..005864626718caaef42516612a418a760c167bcd 100644 --- a/playbooks/task_torch.yml +++ b/playbooks/task_torch.yml @@ -11,6 +11,12 @@ LD_LIBRARY_PATH: /usr/local/python3.7.5/lib:/usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64:/usr/local/gcc7.3.0/lib64 register: torch_result +- name: install apex + shell: python3.7 -m pip install apex --no-index --find-links {{ resources_dir }}/`uname -m` + environment: + PATH: /usr/local/python3.7.5/bin:{{ ansible_env.PATH }} + LD_LIBRARY_PATH: /usr/local/python3.7.5/lib:/usr/local/Ascend/ascend-toolkit/latest/fwkacllib/lib64:/usr/local/gcc7.3.0/lib64 + - debug: var=torch_result - name: check torch