espnet/warp-ctc

Need to set LD_LIBRARY_PATH

Fhrozen opened this issue · 5 comments

I observed that when the cuda ver. is different from the one install in the pc (conda ver=10.0, pc ver=10.2), warpctc cannot be loaded.

(base) nelson@nelson-lab2:/export/db/espnet/libri/tools/venv/lib/python3.7/site-packages/warpctc_pytorch$ ldd _warp_ctc.cpython-37m-x86_64-linux-gnu.so 
	linux-vdso.so.1 (0x00007ffd2a958000)
	libwarpctc.so => /export/db/espnet/libri/tools/venv/lib/python3.7/site-packages/warpctc_pytorch/./lib/libwarpctc.so (0x00007f36be0e5000)
	libcudart.so.10.0 => not found
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f36bdd5c000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f36bd9be000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f36bd7a6000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f36bd587000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f36bd196000)
	libcudart.so.10.0 => not found
	libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f36bcf67000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f36be96d000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f36bcd63000)

The libraries are found in <espnet_dir>/tools/venv/lib, but activate does not add lib to the LD_LIBRARY_PATH.

I am wondering if LD can be configured by setup.py, or then it just keep it manually.

We usually put the LD_LIBRARY_PATH in .bashrc or .bash_profile but do you think this is not enough?
If it is solved by configuring setup.py, I think this would be a good idea.

I also have it LD set for .bashrc, but only the main.
Now, for example if I have different installations of espnet (each with a different cuda ver.) then adding to the .bash will be not good.
I've been thinking that during the installation (with the make), then try to modify the <espnet>/tools/venv/etc/profile.d/conda.sh and add the LD here, so every time the conda env is loaded, it also load its corresponding cuda libs.

Hmm. How about adding it to path.sh manually?
I feel that adding LD to conda.sh may cause some other confusion???

Yes, that could be better.
There was no report of any bug related to this issue so I suppose that people is not having troubles with this.

I will close this.

@sw005320, the issue is mainly because the check_install.py cannot finish correctly. So it will required to add LD to Makefile also when this last check is performed.