Skip to content

Commit

Permalink
Attempt to fix Ubunutu, pyopencl, ray issue.
Browse files Browse the repository at this point in the history
Signed-off by: David Rowenhorst <[email protected]>
  • Loading branch information
drowenhorst-nrl committed Jul 26, 2024
1 parent 4ec8e33 commit 081bda7
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions pyebsdindex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,30 @@
_pyopencl_installed = False
try:
import pyopencl as cl
plt = cl.get_platforms()
if len(plt) > 0:
for p in plt:
g = p.get_devices(device_type=cl.device_type.GPU)
if len(g) > 0:
_pyopencl_installed = True
break

try:
plt = cl.get_platforms()
if len(plt) > 0:
for p in plt:
g = p.get_devices(device_type=cl.device_type.GPU)
if len(g) > 0:
_pyopencl_installed = True
break
except:
raise ImportError('pyopencl could not find GPU')

except ImportError:
_pyopencl_installed = False

#from pyebsdindex.opencl import openclparam
#testcl = openclparam.OpenClParam()
#try:
# gpu = testcl.get_gpu()
# if len(gpu) > 0:
# _pyopencl_installed = True
#except:
# raise ImportError('pyopencl could not find GPU')
except ImportError:
_pyopencl_installed = False
#


try:
import ray
Expand Down

0 comments on commit 081bda7

Please sign in to comment.