Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 969a2e27 authored by hhakim's avatar hhakim
Browse files

Use high level function _is_gpu_mod_enable() instead of checking the library...

Use high level function _is_gpu_mod_enable() instead of checking the library handle is NULL (in pyx code).

Set cuda9.2 gpu_mod prioritary on cuda11.4 to avoid a bug at PSMN (cf #216).
parent f4066405
Branches
No related tags found
No related merge requests found
Pipeline #834200 skipped
...@@ -88,7 +88,7 @@ def enable_gpu_mod(libpaths=None, backend='cuda', silent=False, fatal=False): ...@@ -88,7 +88,7 @@ def enable_gpu_mod(libpaths=None, backend='cuda', silent=False, fatal=False):
# don't use os.path.join or os.path.sep because anyway # don't use os.path.join or os.path.sep because anyway
# lib name suffix and prefix depend on OS # lib name suffix and prefix depend on OS
libpaths = [] libpaths = []
for gpu_backend in ['-cu11.4', '-cu9.2', '']: # the last one is for gpu_backend in ['-cu9.2', '-cu11.4', '']: # the last one is
# for descendant/backward compatibility # for descendant/backward compatibility
# (the backend are sorted per order of preference) # (the backend are sorted per order of preference)
if sys.platform == 'linux': if sys.platform == 'linux':
...@@ -102,10 +102,11 @@ def enable_gpu_mod(libpaths=None, backend='cuda', silent=False, fatal=False): ...@@ -102,10 +102,11 @@ def enable_gpu_mod(libpaths=None, backend='cuda', silent=False, fatal=False):
c_libpath = blibpath c_libpath = blibpath
#c_libpath = libpath #c_libpath = libpath
gm_handle = FaustCoreCy._enable_gpu_mod(c_libpath, silent); gm_handle = FaustCoreCy._enable_gpu_mod(c_libpath, silent);
if gm_handle != NULL: # if gm_handle != NULL:
if _is_gpu_mod_enabled():
# the backend is successfully loaded, end the loading loop # the backend is successfully loaded, end the loading loop
break break
if gm_handle == NULL: else:
if fatal and libpaths[-1] == libpath: if fatal and libpaths[-1] == libpath:
raise Exception("Can't load gpu_mod library, tried all the candidate paths (" raise Exception("Can't load gpu_mod library, tried all the candidate paths ("
+libpaths+"). Maybe they are not" +libpaths+"). Maybe they are not"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment