Commit fcea8d38 authored by chenpangpang's avatar chenpangpang
Browse files

feat: 2.16.1的bug修复:分离出args

parent 9eaaf126
...@@ -25,22 +25,13 @@ if [[ "$1" == *"pytorch"* ]]; then ...@@ -25,22 +25,13 @@ if [[ "$1" == *"pytorch"* ]]; then
" "
elif [[ "$1" == *"tensorflow"* ]]; then elif [[ "$1" == *"tensorflow"* ]]; then
tensorflow_version=$(echo "$1" | cut -d: -f2 | cut -d- -f1) tensorflow_version=$(echo "$1" | cut -d: -f2 | cut -d- -f1)
docker_run_arg=""
# 当tensorflow版本为2.16.1时,不添加环境变量找不到cuda,所以需要这样执行验证。在正常交互式启动容器时,会默认激活/etc/bash.bashrc,可以正常找到cuda # 当tensorflow版本为2.16.1时,不添加环境变量找不到cuda,所以需要这样执行验证。在正常交互式启动容器时,会默认激活/etc/bash.bashrc,可以正常找到cuda
if [[ "$tensorflow_version" == "2.16.1" ]]; then if [[ "$tensorflow_version" == "2.16.1" ]]; then
python_version=$(echo $1 | awk -F'[-:]' '{for(i=3;i<=NF;i++) if($i ~ /^py[0-9]+\.[0-9]+$/) {gsub(/^py/,"",$i); print $i; exit}}') python_version=$(echo $1 | awk -F'[-:]' '{for(i=3;i<=NF;i++) if($i ~ /^py[0-9]+\.[0-9]+$/) {gsub(/^py/,"",$i); print $i; exit}}')
docker run --rm --platform=linux/amd64 --gpus all \ docker_run_arg="-e CUDNN_PATH=\"/opt/conda/lib/python$python_version/site-packages/nvidia/cudnn\" \
-e CUDNN_PATH="/opt/conda/lib/python$python_version/site-packages/nvidia/cudnn" \ -e LD_LIBRARY_PATH=\"/opt/conda/lib/python$python_version/site-packages/nvidia/cudnn/lib:/usr/local/cuda/lib64\""; fi
-e LD_LIBRARY_PATH="/opt/conda/lib/python$python_version/site-packages/nvidia/cudnn/lib:/usr/local/cuda/lib64" \ docker run --rm --platform=linux/amd64 --gpus all $docker_run_arg $1 python -c \
$1 python -c "import os; \
os.system(\"cat /etc/issue\"); \
import sys; \
print(\"python version: \", sys.version); \
import tensorflow as tf; \
print(\"tensorflow version: \", tf.__version__); \
print(\"tensorflow cuda available: \", tf.test.is_gpu_available()); \
os.system('nvcc -V | tail -n 2')
";
else docker run --rm --platform=linux/amd64 --gpus all $1 python -c \
"import os; \ "import os; \
os.system(\"cat /etc/issue\"); \ os.system(\"cat /etc/issue\"); \
import sys; \ import sys; \
...@@ -49,7 +40,7 @@ elif [[ "$1" == *"tensorflow"* ]]; then ...@@ -49,7 +40,7 @@ elif [[ "$1" == *"tensorflow"* ]]; then
print(\"tensorflow version: \", tf.__version__); \ print(\"tensorflow version: \", tf.__version__); \
print(\"tensorflow cuda available: \", tf.test.is_gpu_available()); \ print(\"tensorflow cuda available: \", tf.test.is_gpu_available()); \
os.system('nvcc -V | tail -n 2') os.system('nvcc -V | tail -n 2')
"; fi "
elif [[ "$1" == *"paddle"* ]]; then elif [[ "$1" == *"paddle"* ]]; then
TARGET_DIR=gpu-base-image-test/paddletest TARGET_DIR=gpu-base-image-test/paddletest
docker run --rm --platform=linux/amd64 --gpus all -v ./$TARGET_DIR:/workspace --workdir /workspace $1 python base_test.py docker run --rm --platform=linux/amd64 --gpus all -v ./$TARGET_DIR:/workspace --workdir /workspace $1 python base_test.py
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment