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
OpenDAS
OpenFold
Commits
5820c750
"examples/vscode:/vscode.git/clone" did not exist on "d675d2218e5b271e8434cd03bb3384a2641f12b1"
Commit
5820c750
authored
Aug 11, 2022
by
Tim O'Donnell
Browse files
Fix get_nvidia_cc to handle cases where cuda.cuGetErrorString gives a None result
parent
baf15f8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
scripts/utils.py
scripts/utils.py
+5
-2
No files found.
scripts/utils.py
View file @
5820c750
...
...
@@ -82,13 +82,16 @@ def get_nvidia_cc():
result
=
cuda
.
cuInit
(
0
)
if
result
!=
CUDA_SUCCESS
:
cuda
.
cuGetErrorString
(
result
,
ctypes
.
byref
(
error_str
))
return
None
,
error_str
.
value
.
decode
()
if
error_str
.
value
:
return
None
,
error_str
.
value
.
decode
()
else
:
return
None
,
"Unknown error: cuInit returned %d"
%
result
result
=
cuda
.
cuDeviceGetCount
(
ctypes
.
byref
(
nGpus
))
if
result
!=
CUDA_SUCCESS
:
cuda
.
cuGetErrorString
(
result
,
ctypes
.
byref
(
error_str
))
return
None
,
error_str
.
value
.
decode
()
if
(
nGpus
.
value
<
1
)
:
if
nGpus
.
value
<
1
:
return
None
,
"No GPUs detected"
result
=
cuda
.
cuDeviceGet
(
ctypes
.
byref
(
device
),
0
)
...
...
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