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
bd4a9d7e
Commit
bd4a9d7e
authored
Aug 03, 2022
by
Gustaf Ahdritz
Browse files
Fix error messages in CUDA script
parent
a5f7ec8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
scripts/utils.py
scripts/utils.py
+6
-7
No files found.
scripts/utils.py
View file @
bd4a9d7e
...
@@ -81,21 +81,20 @@ def get_nvidia_cc():
...
@@ -81,21 +81,20 @@ def get_nvidia_cc():
result
=
cuda
.
cuInit
(
0
)
result
=
cuda
.
cuInit
(
0
)
if
result
!=
CUDA_SUCCESS
:
if
result
!=
CUDA_SUCCESS
:
err
=
cuda
.
cuGetErrorString
(
result
,
ctypes
.
byref
(
error_str
))
cuda
.
cuGetErrorString
(
result
,
ctypes
.
byref
(
error_str
))
print
(
err
.
value
.
decode
())
return
None
,
error_str
.
value
.
decode
()
return
None
,
err
.
value
.
decode
()
result
=
cuda
.
cuDeviceGetCount
(
ctypes
.
byref
(
nGpus
))
result
=
cuda
.
cuDeviceGetCount
(
ctypes
.
byref
(
nGpus
))
if
result
!=
CUDA_SUCCESS
:
if
result
!=
CUDA_SUCCESS
:
err
=
cuda
.
cuGetErrorString
(
result
,
ctypes
.
byref
(
error_str
))
cuda
.
cuGetErrorString
(
result
,
ctypes
.
byref
(
error_str
))
return
None
,
err
.
value
.
decode
()
return
None
,
err
or_str
.
value
.
decode
()
if
(
nGpus
.
value
<
1
):
if
(
nGpus
.
value
<
1
):
return
None
,
err
.
value
.
decode
()
return
None
,
err
.
value
.
decode
()
result
=
cuda
.
cuDeviceGet
(
ctypes
.
byref
(
device
),
0
)
result
=
cuda
.
cuDeviceGet
(
ctypes
.
byref
(
device
),
0
)
if
result
!=
CUDA_SUCCESS
:
if
result
!=
CUDA_SUCCESS
:
err
=
cuda
.
cuGetErrorString
(
result
,
ctypes
.
byref
(
error_str
))
cuda
.
cuGetErrorString
(
result
,
ctypes
.
byref
(
error_str
))
return
None
,
err
.
value
.
decode
()
return
None
,
err
or_str
.
value
.
decode
()
if
cuda
.
cuDeviceComputeCapability
(
ctypes
.
byref
(
cc_major
),
ctypes
.
byref
(
cc_minor
),
device
)
!=
CUDA_SUCCESS
:
if
cuda
.
cuDeviceComputeCapability
(
ctypes
.
byref
(
cc_major
),
ctypes
.
byref
(
cc_minor
),
device
)
!=
CUDA_SUCCESS
:
return
None
,
"Compute Capability not found"
return
None
,
"Compute Capability not found"
...
...
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