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
gaoqiong
composable_kernel
Commits
3f291ab9
Commit
3f291ab9
authored
Jul 26, 2022
by
illsilin
Browse files
update script parsing clinfo, throw exception if 0 devices
parent
2bce4c65
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
22 deletions
+11
-22
Jenkinsfile
Jenkinsfile
+11
-22
No files found.
Jenkinsfile
View file @
3f291ab9
...
...
@@ -12,8 +12,9 @@ def show_node_info() {
}
def
runShell
(
String
command
){
def
responseCode
=
sh
returnStatus:
true
,
script:
"${command}
&
> tmp.txt"
def
responseCode
=
sh
returnStatus:
true
,
script:
"${command} > tmp.txt"
def
output
=
readFile
(
file:
"tmp.txt"
)
echo
"tmp.txt contents: $output"
return
(
output
!=
""
)
}
...
...
@@ -115,14 +116,13 @@ def buildHipClangJob(Map conf=[:]){
def
retimage
gitStatusWrapper
(
credentialsId:
"${status_wrapper_creds}"
,
gitHubContext:
"Jenkins - ${variant}"
,
account:
'ROCmSoftwarePlatform'
,
repo:
'composable_kernel'
)
{
try
{
try
(
org
.
jenkinsci
.
plugins
.
workflow
.
steps
.
FlowInterruptedException
e
)
{
retimage
=
docker
.
build
(
"${image}"
,
dockerArgs
+
'.'
)
withDockerContainer
(
image:
image
,
args:
dockerOpts
)
{
timeout
(
time:
5
,
unit:
'MINUTES'
){
sh
'PATH="/opt/rocm/opencl/bin:/opt/rocm/opencl/bin/x86_64:$PATH" clinfo | tee clinfo.log'
if
(
runShell
(
'grep -n "Number of devices:.*. 0" clinfo.log'
)
!=
""
){
echo
"GPU not found"
throw
e
if
(
runShell
(
'grep -n "Number of devices:.*. 0" clinfo.log'
)
){
throw
new
Exception
(
"GPU not found"
)
}
else
{
echo
"GPU is OK"
...
...
@@ -139,9 +139,8 @@ def buildHipClangJob(Map conf=[:]){
withDockerContainer
(
image:
image
,
args:
dockerOpts
)
{
timeout
(
time:
5
,
unit:
'MINUTES'
){
sh
'PATH="/opt/rocm/opencl/bin:/opt/rocm/opencl/bin/x86_64:$PATH" clinfo |tee clinfo.log'
if
(
runShell
(
'grep -n "Number of devices:.*. 0" clinfo.log'
)
!=
""
){
echo
"GPU not found"
throw
e
if
(
runShell
(
'grep -n "Number of devices:.*. 0" clinfo.log'
)
){
throw
new
Exception
(
"GPU not found"
)
}
else
{
echo
"GPU is OK"
...
...
@@ -153,14 +152,6 @@ def buildHipClangJob(Map conf=[:]){
withDockerContainer
(
image:
image
,
args:
dockerOpts
+
' -v=/var/jenkins/:/var/jenkins'
)
{
timeout
(
time:
5
,
unit:
'HOURS'
)
{
sh
'PATH="/opt/rocm/opencl/bin:/opt/rocm/opencl/bin/x86_64:$PATH" clinfo | tee clinfo.log'
if
(
runShell
(
'grep -n "Number of devices:.*. 0" clinfo.log'
)
!=
""
){
echo
"GPU not found"
throw
e
}
else
{
echo
"GPU is OK"
}
cmake_build
(
conf
)
}
}
...
...
@@ -222,9 +213,8 @@ def runCKProfiler(Map conf=[:]){
withDockerContainer
(
image:
image
,
args:
dockerOpts
)
{
timeout
(
time:
5
,
unit:
'MINUTES'
){
sh
'PATH="/opt/rocm/opencl/bin:/opt/rocm/opencl/bin/x86_64:$PATH" clinfo | tee clinfo.log'
if
(
runShell
(
'grep -n "Number of devices:.*. 0" clinfo.log'
)
!=
""
){
echo
"GPU not found"
throw
e
if
(
runShell
(
'grep -n "Number of devices:.*. 0" clinfo.log'
)
){
throw
new
Exception
(
"GPU not found"
)
}
else
{
echo
"GPU is OK"
...
...
@@ -241,9 +231,8 @@ def runCKProfiler(Map conf=[:]){
withDockerContainer
(
image:
image
,
args:
dockerOpts
)
{
timeout
(
time:
5
,
unit:
'MINUTES'
){
sh
'PATH="/opt/rocm/opencl/bin:/opt/rocm/opencl/bin/x86_64:$PATH" clinfo | tee clinfo.log'
if
(
runShell
(
'grep -n "Number of devices:.*. 0" clinfo.log'
)
!=
""
){
echo
"GPU not found"
throw
e
if
(
runShell
(
'grep -n "Number of devices:.*. 0" clinfo.log'
)
){
throw
new
Exception
(
"GPU not found"
)
}
else
{
echo
"GPU is OK"
...
...
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