litenn icon indicating copy to clipboard operation
litenn copied to clipboard

Error found after simple install.

Open dkgaraujo opened this issue 4 years ago • 10 comments

Hello! (I'm a reddit user that saw your post about litenn).

I'm very glad to have had a chance to experiment with LiteNN. However, I encountered the following error upon installation. The procedure I used to install (on MacOS) was to create a separate environment in Anaconda Navigator, then open the terminal using that environment and pip3 install litenn. Then in a jupyter notebook I would type import litenn as nn, resulting in the error below. Any pointer or reference you might have to solve this would be helpful, as I am very keen on trying litenn out. Thank you in advance!


AttributeError Traceback (most recent call last) in ----> 1 import litenn as nn

/opt/anaconda3/envs/litenn/lib/python3.8/site-packages/litenn/init.py in 9 Optimizers in 'nn.optimizer.' namespace 10 """ ---> 11 import litenn.core 12 13

/opt/anaconda3/envs/litenn/lib/python3.8/site-packages/litenn/core/init.py in 2 from .Saveable import Saveable 3 ----> 4 from .minicl import (CLDevice, CLBuffer, CLDevicesBuffers, CLKernel, devices) 5 6 from .CLKernelHelper import CLKernelHelper

/opt/anaconda3/envs/litenn/lib/python3.8/site-packages/litenn/core/minicl/init.py in ----> 1 from .CLDevice import CLDevice 2 from .CLBuffer import CLBuffer 3 from .CLDevicesBuffers import CLDevicesBuffers 4 from .CLKernel import CLKernel 5 from .devices import devices

/opt/anaconda3/envs/litenn/lib/python3.8/site-packages/litenn/core/minicl/CLDevice.py in 1 import numpy as np ----> 2 from .CLBuffer import CLBuffer 3 from .api import OpenCL as CL 4 from .CLShallowMode import CLShallowMode 5

/opt/anaconda3/envs/litenn/lib/python3.8/site-packages/litenn/core/minicl/CLBuffer.py in 1 import numpy as np ----> 2 from .api import OpenCL as CL 3 from .CLShallowMode import CLShallowMode 4 5 class CLBuffer:

/opt/anaconda3/envs/litenn/lib/python3.8/site-packages/litenn/core/minicl/api/OpenCL/init.py in ----> 1 from .OpenCL import (
2 BuildProgram, 3 BUILD_STATUS, 4 DEVICE_TYPE, 5 CreateBuffer,

/opt/anaconda3/envs/litenn/lib/python3.8/site-packages/litenn/core/minicl/api/OpenCL/OpenCL.py in 212 def name(self): return GetPlatformInfo(self, PLATFORM_INFO.PLATFORM_NAME) 213 --> 214 lib_GetPlatformIDs = lib.clGetPlatformIDs 215 lib_GetPlatformIDs.argtypes = cl_uint, POINTER(platform), POINTER(cl_uint) 216 lib_GetPlatformIDs.restype = ERROR

/opt/anaconda3/envs/litenn/lib/python3.8/ctypes/init.py in getattr(self, name) 392 if name.startswith('') and name.endswith(''): 393 raise AttributeError(name) --> 394 func = self.getitem(name) 395 setattr(self, name, func) 396 return func

/opt/anaconda3/envs/litenn/lib/python3.8/ctypes/init.py in getitem(self, name_or_ordinal) 397 398 def getitem(self, name_or_ordinal): --> 399 func = self._FuncPtr((name_or_ordinal, self)) 400 if not isinstance(name_or_ordinal, int): 401 func.name = name_or_ordinal

AttributeError: dlsym(RTLD_DEFAULT, clGetPlatformIDs): symbol not found

dkgaraujo avatar Nov 18 '20 22:11 dkgaraujo

Thanks, I did not test it on mac. Seems like the function clGetPlatformIDs is not found in standard libOpenCL.so what GPU do you have?

iperov avatar Nov 19 '20 05:11 iperov

may be there is a problem with loading libopencl from correct path in macos?

Should I load it from specific path, for example /System/Library/Frameworks/OpenCL.framework/OpenCL ?

iperov avatar Nov 19 '20 05:11 iperov

try to install Opencl drivers

iperov avatar Nov 19 '20 05:11 iperov

Thanks for the pointer, I'll take a look at that. Perhaps there is also some library that bridges dependencies on OpenCL to the Metal framework, since if I recall correctly the OpenCL is being deprecated on Apple (but I may be wrong!). I'll share my experience here, hopefully after I manage to make it work.

dkgaraujo avatar Nov 19 '20 16:11 dkgaraujo

opencl cannot be deprecated. It is standard for all computation devices, not only GPU but also CPU. Even new OpenCL v3.0 has v1.2 subset.

iperov avatar Nov 19 '20 17:11 iperov

That was my source. I am trying to find an easy guide to help me change the relevant parts of the code from OpenCL to Metal but I couldn't find any material.

dkgaraujo avatar Nov 20 '20 10:11 dkgaraujo

because OpenCL is a standard. All you need is opencl drivers for your gpu.

iperov avatar Nov 20 '20 11:11 iperov

maybe you can deal with PoCL? http://portablecl.org/

iperov avatar Nov 20 '20 11:11 iperov

Hi @iperov! So, I actually went and installed LiteNN on my Ubuntu 20.04 machine with AMD Radeon 8670M GPU. However, also there I found an error after calling litenn.test.all():

litenn.core.minicl.api.OpenCL.CLException: PLATFORM_NOT_FOUND_KHR. Any pointers? Thanks in advance.

dkgaraujo avatar Nov 25 '20 22:11 dkgaraujo

this is drivers related error

iperov avatar Nov 26 '20 06:11 iperov