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

lua: hello.lua:3: module 'moonvulkan' not found: #6

Open
filu34 opened this issue May 20, 2022 · 4 comments
Open

lua: hello.lua:3: module 'moonvulkan' not found: #6

filu34 opened this issue May 20, 2022 · 4 comments

Comments

@filu34
Copy link

filu34 commented May 20, 2022

$ lua hello.lua
lua: hello.lua:3: module 'moonvulkan' not found:
no field package.preload['moonvulkan']
no file '/usr/share/lua/5.4/moonvulkan.lua'
no file '/usr/share/lua/5.4/moonvulkan/init.lua'
no file '/usr/lib/lua/5.4/moonvulkan.lua'
no file '/usr/lib/lua/5.4/moonvulkan/init.lua'
no file './moonvulkan.lua'
no file './moonvulkan/init.lua'
no file '/usr/lib/lua/5.4/moonvulkan.so'
no file '/usr/lib/lua/5.4/loadall.so'
no file './moonvulkan.so'
stack traceback:
[C]: in function 'require'
hello.lua:3: in main chunk
[C]: in ?

Instructions from README.md aren't clear. How to bind it with Vulkan?
@stetre
Copy link
Owner

stetre commented May 20, 2022

Can't say much from this error message, except that Lua did not find MoonVulkan's files where they are supposed to be installed. This may be have different causes. Either

  • you did not install MoonVulkan, or
  • you did not build MoonVulkan for the Lua version you are using (5.4), or
  • you installed MoonVulkan in a non-standard location which Lua isn't aware of.

Did the installation process go smooth, or did it give you some errors of any kind?

As for the last question, MoonVulkan loads the Vulkan loader (a shared object) at runtime using dlopen, and then retrieves the function pointers of the Vulkan API commands as explained in the Vulkan manual. The above error has nothing to do with this, though, since MoonVulkan did not start to begin with.

@filu34
Copy link
Author

filu34 commented May 20, 2022

$ sudo make install

make[1]: Entering directory '/home/user/moonvulkan/src'
'moonvulkan.h' -> '/usr/local/include/moonvulkan.h'
'../moonvulkan/constructors.lua' -> '/usr/local/share/lua/5.4/moonvulkan/constructors.lua'
'moonvulkan.so' -> '/usr/local/lib/lua/5.4/moonvulkan.so'
'/usr/local/lib/libmoonvulkan.so' -> '/usr/local/lib/lua/5.4/moonvulkan.so'
make[1]: Leaving directory '/home/user/moonvulkan/src'

And make itself didn't throw any errors.

$ pacman -Q | grep "vulkan"

lib32-vulkan-icd-loader 1.3.213-1
lib32-vulkan-intel 22.0.3-1
vulkan-headers 1:1.3.213-1
vulkan-icd-loader 1.3.213-1
vulkan-intel 22.0.3-1
vulkan-tools 1.3.213-1

$ sudo pacman -S vulkan-devel

:: There are 7 members in group vulkan-devel:
:: Repository extra

  1. spirv-tools 2) vulkan-extra-layers 3) vulkan-extra-tools
  2. vulkan-headers 5) vulkan-html-docs 6) vulkan-tools
  3. vulkan-validation-layers

@filu34
Copy link
Author

filu34 commented May 20, 2022

Does it indicate that I need to install and configure Vulkan SDK as in https://vulkan.lunarg.com/doc/sdk/1.3.211.0/linux/getting_started.html ?

@stetre
Copy link
Owner

stetre commented May 21, 2022

Does it indicate that I need to install and configure Vulkan SDK as in https://vulkan.lunarg.com/doc/sdk/1.3.211.0/linux/getting_started.html ?

Yes. And of course you need vulkan-capable driver(s) for your device(s). This is actually indicated in the readme (see the Getting and installing section).

Back to the original problem. By comparing the error message in your first post, and the output of the install command, you can see that the Lua interpreter doesn't look for the moonvulkan files in the paths where they are installed, which are subfolders of /usr/local (you can see where Lua searches for modules by printing out the package.path and package.cpath variables).

To fix this problem you can either:

  • add the /usr/local paths to the Lua search paths (see the Lua manual for details), or
  • reinstall moonvulkan with a different prefix than the default /usr/local. In your case, this should do:
    $ sudo make PREFIX=/usr install

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