Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPCasCode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hpc-team
HPCasCode
Commits
b9a2b4b3
Commit
b9a2b4b3
authored
5 years ago
by
Simon Michnowicz
Browse files
Options
Downloads
Patches
Plain Diff
modified detection of pci bus id's to account for baremetal machines have a different format
Former-commit-id:
b67df474
parent
7e67ec55
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
roles/gpu/files/scripts/nvidia-xconf-gen.py
+12
-2
12 additions, 2 deletions
roles/gpu/files/scripts/nvidia-xconf-gen.py
with
12 additions
and
2 deletions
roles/gpu/files/scripts/nvidia-xconf-gen.py
+
12
−
2
View file @
b9a2b4b3
...
...
@@ -29,8 +29,18 @@ def grab_card_ids():
cards
=
[]
for
line
in
p
.
stdout
.
readlines
():
line
=
line
.
rstrip
().
split
(
"
:
"
)[
2
]
pcibus_num
=
int
(
re
.
sub
(
'
[.:]
'
,
''
,
line
).
rstrip
(
"
0
"
),
16
)
stripped_line
=
line
.
rstrip
().
split
(
"
:
"
)[
2
]
#check for different format of pcibus_id. This happens on baremetals
# i.e. 00000000:06:00.0 not 00000000:00:06.0
pcibus_id
=
re
.
sub
(
'
[.:]
'
,
''
,
stripped_line
).
rstrip
(
"
0
"
)
if
not
pcibus_id
:
# empty string, try the other way
stripped_line
=
line
.
rstrip
().
split
(
"
:
"
)[
1
]
pcibus_id
=
re
.
sub
(
'
[.:]
'
,
''
,
stripped_line
).
rstrip
(
"
0
"
)
if
not
pcibus_id
:
print
(
"
Error in grab_card_ids: we can not parse the line {}
"
.
format
(
line
))
print
(
"
Command that generated it is: {}
"
.
format
(
cmd
))
system
.
exit
(
1
)
pcibus_num
=
int
(
pcibus_id
,
16
)
card
=
"
PCI:0:{}:0
"
.
format
(
str
(
pcibus_num
))
cards
.
append
(
card
)
return
cards
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment