Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
gpu-base-image-build
Commits
fcea8d38
Commit
fcea8d38
authored
Oct 23, 2024
by
chenpangpang
Browse files
feat: 2.16.1的bug修复:分离出args
parent
9eaaf126
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
14 deletions
+5
-14
script/1_base_test.sh
script/1_base_test.sh
+5
-14
No files found.
script/1_base_test.sh
View file @
fcea8d38
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment