-
Notifications
You must be signed in to change notification settings - Fork 221
Dynamic load of nvidia libs #765
Comments
Thankyou for your suggestion. We think we will do something like this when our GPU support is further along. At this time we do not yet have a contributor license agreement (CLA) procedure in place. Until that is resolved, we won't be able to accept outside contributions. |
Thank you, you are welcome. |
Hi @diyessi
Kind |
External libraries need to go through an approval process that looks into licensing, IP, security, etc. |
If I may emit 2 warnings/advices :
|
Thanks @WilliamTambellini. As you suggest, we'd like to dynamically load nvrtc, cuda, cublas, and cudnn all in one go. CUEW's cross-platform support is attractive and may be a good starting point if cudnn can be added in a straightforward way. Per your original question, we are still awaiting information on contributors licensing but hope to have that good to go soon. If you want to take a stab at it in the mean time, I'm more than happy to review / merge once we have our contributors license up. Otherwise, it's on our roadmap and I will provide updates here when this is underway internally. |
Thank you @csullivan : I see enough reasons to wait a little :
To be continued. |
Early result from the cudnn support in cuew : |
@WilliamTambellini the update looks promising, I'll give it a review, thanks |
Hi all
As today, if ngraph is compiled with NGRAPH_GPU_ENABLE=TRUE (which ofcourse needs a nvidia ecosystem installed) then libngraph.so is hardly linked with few nvidia libs:
`ldd /tmp/ngraph/lib/libngraph.so
libcuda.so.1 => /usr/lib/x86_64-linux-gnu/libcuda.so.1
libnvrtc.so.8.0 => /usr/local/cuda-8.0/targets/x86_64-linux/lib/libnvrtc.so.8.0
libcublas.so.8.0 => /usr/local/cuda-8.0/targets/x86_64-linux/lib/libcublas.so.8.0
libcudnn.so.7 => /usr/local/cuda-8.0/targets/x86_64-linux/lib/libcudnn.so.7
libnvidia-fatbinaryloader.so.375.74 => /usr/lib/nvidia-375/libnvidia-fatbinaryloader.so.375.74
...
`
For production & deployment purpose, this is not practical because such a libngraph build wont be able to be loaded at all on machines without the nvidia gpu ecosystem, ie cpu only.
Thanks to the fact that the ngraph arch is pretty clean, this is only needed for some C function calls needed in the gpu backend only (ngraph/src/ngraph/runtime/gpu) : cublasCreate, cudnnCreate, cublasSetPointerMode, cublasDestroy, cuInit, cuDeviceGet, cuCtxCreate, nvrtcCreateProgram, nvrtcCompileProgram, nvrtcGetPTXSize, nvrtcGetPTX, nvrtcDestroyProgram, cuLaunchKernel, ...
It could be possible to dynamically load these libs using standard posix 'dl' :
http://man7.org/linux/man-pages/man3/dlopen.3.html
The PyTorch team seems to also try to do such :
pytorch/pytorch#3395
Before moving forward, would you be open to this idea or do you see any red flags ?
Kind
W.
The text was updated successfully, but these errors were encountered: