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 cuda 10 turbo error #307

Open
deepdab opened this issue Oct 11, 2019 · 5 comments
Open

web.lua cuda 10 turbo error #307

deepdab opened this issue Oct 11, 2019 · 5 comments

Comments

@deepdab
Copy link

deepdab commented Oct 11, 2019

I'm running Ubuntu 18.04 on an NVIDIA Jetson Nano which has CUDA 10 and cuDNN 7.5 installed by default. I followed issue #253 (comment) and was able to build Torch successfully. Then I installed the additional lua modules for waifu2x and validated successfully when running th waifu2x.lua -force_cudnn 1. (waifu2x runs out of memory on this device without using cuDNN. I'm not too concern about this as long as it works using cuDNN.)

When I tried running th web.lua -force_cudnn 1 however, I get the following error:

/home/user/torch/install/bin/luajit: /home/user/torch/install/share/lua/5.1/trepl/init.lua:389: /home/user/torch/install/share/lua/5.1/trepl/init.lua:389: /home/user/torch/install/share/lua/5.1/trepl/init.lua:389: /home/user/torch/install/share/lua/5.1/turbo/util.lua:98: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
        [C]: in function 'error'
        /home/user/torch/install/share/lua/5.1/trepl/init.lua:389: in function 'require'
        web.lua:21: in main chunk
        [C]: in function 'dofile'
        ...user/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
        [C]: at 0x558c9d9a68
@nagadomi
Copy link
Owner

I guess that turbo.lua's architecture detection is not working on NVIDIA Jetson Nano(cmds is null).
https://github.com/kernelsauce/turbo/blob/7fe88c2b99ff9bd6d6df3ee3c4077ea8a7d1e6a3/turbo/syscall.lua#L54-L141

It is a platform support issue of turbo.lua. https://github.com/kernelsauce/turbo
I don't know the Linux specifications of Jetson Nano, so I don't know if it can be fixed easily.

@nagadomi
Copy link
Owner

You can check the value of ffi.arch with the following command.

% th -e "ffi = require 'ffi'; print(ffi.arch)"
x64	

@deepdab
Copy link
Author

deepdab commented Oct 11, 2019

Thanks for the tips. The following command shows:

% th -e "ffi = require 'ffi'; print(ffi.arch)"
arm64

and arm64 indeed does not show up in the syscall.lua file. Adding an or ffi.arch == "arm64" to arm doesn't display that error anymore, but when trying to access the webpage, a bunch of Critical error, no handler for fd: 0. messages are displayed. Not surprising since I'm sure arm64 has a different set of syscall numbers. The challenge is that it appears some of those syscalls for arm64 have been deprecated, so it's not easy to find the exact matching numbers.

Since this looks more like an issue with turbo I can ask their developers for assistance.

Thanks!

@nagadomi
Copy link
Owner

nagadomi commented Oct 11, 2019

On x64 Linux, syscall ids can be show with the following program. (If the syscall name does not exist, a compile error will occur.)

#include <sys/syscall.h>
#include <stdio.h>

int main(void)
{
	printf("SYS_stat = %d,\n", SYS_stat);
	printf("SYS_fstat = %d,\n", SYS_fstat);
	printf("SYS_lstat = %d,\n", SYS_lstat);
	printf("SYS_getdents = %d,\n", SYS_getdents);
	printf("SYS_io_setup = %d,\n", SYS_io_setup);
	printf("SYS_io_destroy = %d,\n", SYS_io_destroy);
	printf("SYS_io_getevents = %d,\n", SYS_io_getevents);
	printf("SYS_io_submit = %d,\n", SYS_io_submit);
	printf("SYS_io_cancel = %d,\n", SYS_io_cancel);
	printf("SYS_clock_settime = %d,\n", SYS_clock_settime);
	printf("SYS_clock_gettime = %d,\n", SYS_clock_gettime);
	printf("SYS_clock_getres = %d,\n", SYS_clock_getres);
	printf("SYS_clock_nanosleep = %d,\n", SYS_clock_nanosleep);

	return 0;
}
% gcc syscall_list.c -o syscall_list
% ./syscall_list 
SYS_stat = 4,
SYS_fstat = 5,
SYS_lstat = 6,
SYS_getdents = 78,
SYS_io_setup = 206,
SYS_io_destroy = 207,
SYS_io_getevents = 208,
SYS_io_submit = 209,
SYS_io_cancel = 210,
SYS_clock_settime = 227,
SYS_clock_gettime = 228,
SYS_clock_getres = 229,
SYS_clock_nanosleep = 230,

@deepdab
Copy link
Author

deepdab commented Oct 11, 2019

Thanks. Not surprisingly, I get an error for SYS_stat, SYS_lstat, and SYS_getdents.

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

2 participants