Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web.lua does not work #3

Closed
slayerduck opened this issue May 21, 2015 · 10 comments
Closed

Web.lua does not work #3

slayerduck opened this issue May 21, 2015 · 10 comments

Comments

@slayerduck
Copy link

Successfully installed everything, i can use the command line to convert images but the web gui errors out

[root@waifu2x waifu2x-master]# th web.lua
/root/torch/install/bin/luajit: /root/torch/install/share/lua/5.1/trepl/init.lua:363: /root/torch/install/share/lua/5.1/trepl/init.lua:363: /root/torch/install/share/lua/5.1/trepl/init.lua:363: /usr/local/share/lua/5.1/turbo/epoll_ffi.lua:69: bad argument #1 to 'new' (size of C type is unknown or too large)
stack traceback:
[C]: in function 'error'
/root/torch/install/share/lua/5.1/trepl/init.lua:363: in function 'require'
web.lua:4: in main chunk
[C]: in function 'dofile'
/root/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk
[C]: at 0x004064d0

@nagadomi
Copy link
Owner

try upgrade luajit version to 2.0.4.
http://luajit.org/download.html

@slayerduck
Copy link
Author

I'm already running 2.0.4

@nagadomi
Copy link
Owner

hmm.. seems turbo.lua failed to detecting your platform.
maybe following patch fixes this issue.
edit file: turbo/turbo/platform.lua (https://github.com/kernelsauce/turbo/blob/master/turbo/platform.lua#L30)

    __ABI32__ = false, -- true if your platform is i386
    __ABI64__ = true, -- true if your platform is x86-64

and reinstall.
if you need more support, please create a issue in turbo (https://github.com/kernelsauce/turbo)

@slayerduck
Copy link
Author

After changing that and recompiling i get this:

/root/torch/install/bin/luajit: /root/torch/install/share/lua/5.1/trepl/init.lua:363: /root/torch/install/share/lua/5.1/trepl/init.lua:363: /usr/local/share/lua/5.1/turbo/util.lua:351: Could not load libtffi_wrap
Please run makefile and ensure that installation is done correct.
stack traceback:
[C]: in function 'error'
/root/torch/install/share/lua/5.1/trepl/init.lua:363: in function 'require'
web.lua:4: in main chunk
[C]: in function 'dofile'
/root/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in main chunk
[C]: at 0x004064d0

@Saren-Arterius
Copy link

I am getting this (Could not load libtffi_wrap) too.

@nagadomi
Copy link
Owner

try

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
th web.lua

@slayerduck
Copy link
Author

Works, can be closed thanks!

TIP for other people facing this issue: add the line export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib to your .bashrc

@FantasyJXF
Copy link

I met the error Could not load libtffi_wrap

try

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
th web.lua

This doesn't work on my case.

My Env:

  • CentOS 7.3
  • GPU V100 with driver 410.129
  • CUDA 10

After I install turbo with luarocks, the output is :

==== Installing libtffi_wrap ====
test -f libtffi_wrap.so && \
install -m 0755 libtffi_wrap.so /home/work/torch/install/lib/libtffi_wrap.so.2.1.0 && \
ldconfig -n /home/work/torch/install/lib && \
ln -sf libtffi_wrap.so.2.1.0 /home/work/torch/install/lib/libtffi_wrap.so
==== Successfully installed Turbo.lua 2.1.0 to /home/work/torch/install ====
Updating manifest for /home/work/torch/install/lib/luarocks/rocks
turbo 2.1-2 is now built and installed in /home/work/torch/install/ (license: Apache 2.0)

I notice that my libtffi_wrap.so was located in $HOME/torch/install/lib not /usr/lib

@nagadomi
Copy link
Owner

nagadomi commented Jan 5, 2020

Run

~/torch/install/bin/torch-activate

This script adds ~/torch/install/lib to LD_LIBRARY_PATH.
Also, this script is registered in ~/.bashrc or ~/.zshrc when installing torch, so it will be automatically applied once you login again.

@FantasyJXF
Copy link

FantasyJXF commented Jan 5, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants