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

glsl file COMPILER ERROR #101

Closed
Sorry-Im-Stupid opened this issue Jul 24, 2021 · 30 comments
Closed

glsl file COMPILER ERROR #101

Sorry-Im-Stupid opened this issue Jul 24, 2021 · 30 comments
Labels

Comments

@Sorry-Im-Stupid
Copy link

Sorry-Im-Stupid commented Jul 24, 2021

Hello, I'm attempting to use Malt, obviously, and I've run into a bug that I'm not seeing anywhere else.

EDIT: I have now read the previous bug report on this issue, remembering that I had seen it once before ( see my username). I will give a local compile another go, and report back.

I tried again to compile it, and it's failing again. Says it's missing pip. It occurs to me, if the blender python package is missing pip, the whole thing shouldn't work, right? I'm not a coder, I'm a 3D guy.
Am I needing to install a separate pip module and tell the compiler to use that? I don;t know how to do that, if that's what it is.

Malt installed just fine (I've tried this with a few releases, including attempting to compile it myself), and it seems to run just fine, but when I load up a .glsl file from the included samples, all I get is the following:

PRE_PASS : SHADER COMPILER ERROR :
0:4(1): error: syntax error, unexpected $undefined
SHADER COMPILER ERROR :
0:4(1): error: syntax error, unexpected $undefined
SHADER LINKER ERROR :
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shaderMAIN_PASS : SHADER COMPILER ERROR :
0:4(1): error: syntax error, unexpected $undefined
SHADER COMPILER ERROR :
0:4(1): error: syntax error, unexpected $undefined
SHADER LINKER ERROR :
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shaderSHADOW_PASS : SHADER COMPILER ERROR :
0:4(1): error: syntax error, unexpected $undefined
SHADER COMPILER ERROR :
0:4(1): error: syntax error, unexpected $undefined
SHADER LINKER ERROR :
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader

The file path between blender and these files is clear, and I've also checked that there are no blank spaces in folder names between them because that sometimes causes problems for me.

I've installed pip, I guess I didn't have it, somehow. The compile still says it's not there, and now when I try to use Malt it spits out this:

Traceback (most recent call last):
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/scripts/modules/addon_utils.py", line 351, in enable
mod = import(module_name)
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/scripts/addons/BlenderMalt/init.py", line 22, in
import Malt
File "/home/maker/Malt/BlenderMalt/.MaltPath/Malt/init.py", line 4, in
from Malt import Parameter
File "/home/maker/Malt/BlenderMalt/.MaltPath/Malt/Parameter.py", line 3, in
from Malt.GL import GL
File "/home/maker/Malt/BlenderMalt/.MaltPath/Malt/GL/GL.py", line 9, in
from OpenGL.GL import *
ModuleNotFoundError: No module named 'OpenGL.GL'

I'm running Linux Mint 20.1, on an old Dell workstation with 2x 4-core Xeon E5420. GPU MSI Radeon RX 580 (all up to date drivers and Kernel)

Any help here would be appreciated, as I'd really like to understand the 3D cartooney art style.

@BerlinAW
Copy link

BerlinAW commented Jul 24, 2021

Hello.

I am having a similar issue. I think. It is a little hard to diagnose. I am getting the same shader compile errors that you are.

Currently running a fully patched Manjaro Linux install. Using the plasma desktop, radeon graphics and an amd cpu.

This is a fresh download of both Malt/Beer and the example shaders

Out of the gate blender counsel was telling me that it was:

Unable to load numpy_formathandler accelerator from OpenGL_accelerate >

Through some research on the net I found a similar error for people struggling getting windows to draw stuff in python. They installed the following libs to get it to work.

  • numpy (+mkl) --> Already on my system
  • scipy
  • PyOpenGL
  • PyOpenGL_accelerate --> I assume this one was my problem.
  • pygame

But now I think I am stuck at the same position you are in. Similar wording to your error but a slight difference. Wonder if that might just be the difference in operating systems / python versions.

Error: PRE_PASS : SHADER COMPILER ERROR :
0:4(1): error: syntax error, unexpected invalid token
SHADER COMPILER ERROR :
0:4(1): error: syntax error, unexpected invalid token
SHADER LINKER ERROR :
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shaderMAIN_PASS : SHADER COMPILER ERROR :
0:4(1): error: syntax error, unexpected invalid token
SHADER COMPILER ERROR :
0:4(1): error: syntax error, unexpected invalid token
SHADER LINKER ERROR :
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shaderSHADOW_PASS : SHADER COMPILER ERROR :
0:4(1): error: syntax error, unexpected invalid token
SHADER COMPILER ERROR :
0:4(1): error: syntax error, unexpected invalid token
SHADER LINKER ERROR :
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader

System / Blender logs don't seem to reveal anything useful.

I am wondering if it is some library that is missing on my system??? If that is the case, it is a little unclear to me where to begin tracking that down.

Otherwise, this project looks super interesting. Really looking forward to testing it out.

Thanks!

@BerlinAW
Copy link

Now it's my to to say... no I'm sorry, I'm Stupid. Should have looked through all the closed tickets.

#43

@Sorry-Im-Stupid The above thread describes a similar issue. And they recommend compiling the plugin. I assume you already tried this based on your above post. Personally I have been struggling figuring out the exact syntax to compile the plugin on linux to test.

EX (I just dumped the git clone into my user home directory):

blender ~/Malt/scripts/setup_blender_addon.py --scripts-folder ~/.config/blender/2.93/scripts/

Traceback (most recent call last):
File "/usr/share/blender/2.93/scripts/modules/addon_utils.py", line 351, in enable
mod = import(module_name)
ModuleNotFoundError: No module named 'BlenderMalt'
Error: File format is not supported in file '/home/sberlinger/Malt/scripts/setup_blender_addon.py'
Error: argument has no '.blend' file extension, not using as new file, exiting! /home/sberlinger/Malt/scripts/setup_blender_addon.py

@Sorry-Im-Stupid
Copy link
Author

From your post, I ensured I had the listed packages installed, I got all except PyOpenGL_Accelerate. That one didn't show up in the available libraries.
With everything else installed, still nothing. It still doesn't load the glsl files.

@Sorry-Im-Stupid
Copy link
Author

Sorry-Im-Stupid commented Jul 24, 2021

Now it's my to to say... no I'm sorry, I'm Stupid. Should have looked through all the closed tickets.

#43

@Sorry-Im-Stupid The above thread describes a similar issue. And they recommend compiling the plugin. I assume you already tried this based on your above post. Personally I have been struggling figuring out the exact syntax to compile the plugin on linux to test.

EX (I just dumped the git clone into my user home directory):

blender ~/Malt/scripts/setup_blender_addon.py --scripts-folder ~/.config/blender/2.93/scripts/

Traceback (most recent call last):
File "/usr/share/blender/2.93/scripts/modules/addon_utils.py", line 351, in enable
mod = import(module_name)
ModuleNotFoundError: No module named 'BlenderMalt'
Error: File format is not supported in file '/home/sberlinger/Malt/scripts/setup_blender_addon.py'
Error: argument has no '.blend' file extension, not using as new file, exiting! /home/sberlinger/Malt/scripts/setup_blender_addon.py

If you figure out a syntax that works for you, I'll try it myself.

I'm trying the local compile from scratch, again, and I'm now getting a repeat error where it's failing to install pip.
I know I have pip, so how is it failing now?
Also according to this I don't have cmake? I thought I did. Fine, I'll get that again.

Traceback (most recent call last):
File "/home/maker/Malt/BlenderMalt/CBlenderMalt/build.py", line 15, in
subprocess.check_call(['cmake', '..'], cwd=build_dir)
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 368, in check_call
retcode = call(*popenargs, **kwargs)
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 349, in call
with Popen(*popenargs, **kwargs) as p:
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 1823, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cmake'
Traceback (most recent call last):
File "/home/maker/Malt/scripts/setup_blender_addon.py", line 18, in build_lib
subprocess.check_call([sys.executable, 'build.py'], cwd=path)
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/python3.9', 'build.py']' returned non-zero exit status 1.
Traceback (most recent call last):
File "/home/maker/Malt/Bridge/ipc/build.py", line 15, in
subprocess.check_call(['cmake', '..'], cwd=build_dir)
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 368, in check_call
retcode = call(*popenargs, **kwargs)
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 349, in call
with Popen(*popenargs, **kwargs) as p:
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 1823, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cmake'
Traceback (most recent call last):
File "/home/maker/Malt/scripts/setup_blender_addon.py", line 18, in build_lib
subprocess.check_call([sys.executable, 'build.py'], cwd=path)
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/python3.9', 'build.py']' returned non-zero exit status 1.
/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/python3.9: No module named pip
ERROR: pip install glfw failed.
Traceback (most recent call last):
File "/home/maker/Malt/scripts/install_dependencies.py", line 12, in
subprocess.check_call([sys.executable, '-m', 'pip', 'install', dependency, '--target', malt_dependencies_path])
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/python3.9', '-m', 'pip', 'install', 'glfw', '--target', '/home/maker/Malt/scripts/../Malt/.Dependencies-39']' returned non-zero exit status 1.
/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/python3.9: No module named pip
ERROR: pip install PyOpenGL failed.
Traceback (most recent call last):
File "/home/maker/Malt/scripts/install_dependencies.py", line 12, in
subprocess.check_call([sys.executable, '-m', 'pip', 'install', dependency, '--target', malt_dependencies_path])
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/python3.9', '-m', 'pip', 'install', 'PyOpenGL', '--target', '/home/maker/Malt/scripts/../Malt/.Dependencies-39']' returned non-zero exit status 1.
/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/python3.9: No module named pip
ERROR: pip install PyOpenGL_accelerate failed.
Traceback (most recent call last):
File "/home/maker/Malt/scripts/install_dependencies.py", line 12, in
subprocess.check_call([sys.executable, '-m', 'pip', 'install', dependency, '--target', malt_dependencies_path])
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/python3.9', '-m', 'pip', 'install', 'PyOpenGL_accelerate', '--target', '/home/maker/Malt/scripts/../Malt/.Dependencies-39']' returned non-zero exit status 1.
/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/python3.9: No module named pip
ERROR: pip install pcpp failed.
Traceback (most recent call last):
File "/home/maker/Malt/scripts/install_dependencies.py", line 12, in
subprocess.check_call([sys.executable, '-m', 'pip', 'install', dependency, '--target', malt_dependencies_path])
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/python3.9', '-m', 'pip', 'install', 'pcpp', '--target', '/home/maker/Malt/scripts/../Malt/.Dependencies-39']' returned non-zero exit status 1.
/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/python3.9: No module named pip
ERROR: pip install Pyrr failed.
Traceback (most recent call last):
File "/home/maker/Malt/scripts/install_dependencies.py", line 12, in
subprocess.check_call([sys.executable, '-m', 'pip', 'install', dependency, '--target', malt_dependencies_path])
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/python3.9', '-m', 'pip', 'install', 'Pyrr', '--target', '/home/maker/Malt/scripts/../Malt/.Dependencies-39']' returned non-zero exit status 1.
/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/python3.9: No module named pip
ERROR: pip install psutil failed.
Traceback (most recent call last):
File "/home/maker/Malt/scripts/install_dependencies.py", line 12, in
subprocess.check_call([sys.executable, '-m', 'pip', 'install', dependency, '--target', malt_dependencies_path])
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/python3.9', '-m', 'pip', 'install', 'psutil', '--target', '/home/maker/Malt/scripts/../Malt/.Dependencies-39']' returned non-zero exit status 1.

I have Cmake now, that part worked. Still pip failing.

@Sorry-Im-Stupid
Copy link
Author

pip -V
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

Is this right? I know blender's python version is 3.9, so is there a newer version of pip I should be running?

@BerlinAW
Copy link

Hi Sorry,

I have

pip -V
pip 20.3.4 from /usr/lib/python3.9/site-packages/pip (python 3.9)

But that is probably because I am running Arch / Manjaro. Linux Mint, in your case, pulls from ubuntu's repos but they are on a pretty curated release cycle.

I grabbed myself a fresh cup of tea, I am going to try a few more random ideas I had and see where it goes.

@Sorry-Im-Stupid
Copy link
Author

I will see about updating pip, and see if that fixes it.
Thanks.

@Sorry-Im-Stupid
Copy link
Author

Sorry-Im-Stupid commented Jul 24, 2021

I've installed python3.9, but I can't get it to install the new pip to go with it.
My system seems to be insisting on using python3.8, so it won't update pip to a 3.9 version.

I have now installed pip21.1.3 in the python3.9 install! Now how do I get that install to do the Malt install?

@BerlinAW
Copy link

Okay, It isn't running yet. But I have progress to report.

To "compile" the python stuff. I figured I would consolidate my work area a bit. I hopped into my ~/.config/blender directory and created a folder called Custom_Scripts. In side that folder made a new one called Scripts and I piped blender to that subfolder as a custom script location.

Inside of my Custom_Scripts folder I ran:

git clone https://github.com/bnpr/Malt.git

Then I ran this

python ./Malt/scripts/setup_blender_addon.py --scripts-folder ./Scripts/

Then the script starts running and it trigger's pip to download all the needed libraries.
according to the install_dependencies.py

If it does not do it automatically, the packages you need are:

  • 'glfw',
  • 'PyOpenGL',
  • 'PyOpenGL_accelerate',
  • 'pcpp',
  • 'Pyrr',
  • 'psutil'
  • numpy

It ran through the whole thing and finished successfully. Blender had the plugin checked in the add-on manager. I toggled it just for giggles to see if it was working. When I re-enabled it.

Traceback (most recent call last):
File "/usr/share/blender/2.93/scripts/modules/addon_utils.py", line 351, in enable
mod = import(module_name)

Etc.....

I did not see any indications when the script was running that it compiled any C libraries.

So the next thing think I am going to looking to see if I can compile them seperately

@Sorry-Im-Stupid
Copy link
Author

Sorry-Im-Stupid commented Jul 24, 2021

Progress! Ok, I tried your method, but specifically called python3.9, and pip did activate!
But it still spat out a few errors, as it couldn't install some packages.

-- Install configuration: "Release"
-- Installing: /home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/usr_scripts/Malt/Bridge/ipc/libIpc.so
Collecting glfw
Downloading glfw-2.1.0-py2.py27.py3.py30.py31.py32.py33.py34.py35.py36.py37.py38-none-manylinux2014_x86_64.whl (205 kB)
|████████████████████████████████| 205 kB 1.7 MB/s
Installing collected packages: glfw
Successfully installed glfw-2.1.0
Collecting PyOpenGL
Downloading PyOpenGL-3.1.5-py3-none-any.whl (2.4 MB)
|████████████████████████████████| 2.4 MB 1.6 MB/s
Installing collected packages: PyOpenGL
Successfully installed PyOpenGL-3.1.5
Collecting PyOpenGL_accelerate
Downloading PyOpenGL-accelerate-3.1.5.tar.gz (538 kB)
|████████████████████████████████| 538 kB 1.9 MB/s
Building wheels for collected packages: PyOpenGL-accelerate
Building wheel for PyOpenGL-accelerate (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8d1q8q6n/pyopengl-accelerate_955a7509e7ef40f2a3812d0a7806d532/setup.py'"'"'; file='"'"'/tmp/pip-install-8d1q8q6n/pyopengl-accelerate_955a7509e7ef40f2a3812d0a7806d532/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-h8dyu780
cwd: /tmp/pip-install-8d1q8q6n/pyopengl-accelerate_955a7509e7ef40f2a3812d0a7806d532/
Complete output (18 lines):
Unable to import numpy, skipping numpy extension building
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/OpenGL_accelerate
copying OpenGL_accelerate/init.py -> build/lib.linux-x86_64-3.9/OpenGL_accelerate
running build_ext
building 'OpenGL_accelerate.wrapper' extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/src
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/tmp/pip-install-8d1q8q6n/pyopengl-accelerate_955a7509e7ef40f2a3812d0a7806d532/.. -I/tmp/pip-install-8d1q8q6n/pyopengl-accelerate_955a7509e7ef40f2a3812d0a7806d532/src -I/tmp/pip-install-8d1q8q6n/pyopengl-accelerate_955a7509e7ef40f2a3812d0a7806d532 -I/usr/include/python3.9 -c src/wrapper.c -o build/temp.linux-x86_64-3.9/src/wrapper.o
src/wrapper.c:4:10: fatal error: Python.h: No such file or directory
4 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

ERROR: Failed building wheel for PyOpenGL-accelerate
Running setup.py clean for PyOpenGL-accelerate
Failed to build PyOpenGL-accelerate
Installing collected packages: PyOpenGL-accelerate
Running setup.py install for PyOpenGL-accelerate ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8d1q8q6n/pyopengl-accelerate_955a7509e7ef40f2a3812d0a7806d532/setup.py'"'"'; file='"'"'/tmp/pip-install-8d1q8q6n/pyopengl-accelerate_955a7509e7ef40f2a3812d0a7806d532/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-k0vm3i1r/install-record.txt --single-version-externally-managed --home /tmp/pip-target-7yvvgcr5 --compile --install-headers /tmp/pip-target-7yvvgcr5/include/python/PyOpenGL-accelerate
cwd: /tmp/pip-install-8d1q8q6n/pyopengl-accelerate_955a7509e7ef40f2a3812d0a7806d532/
Complete output (18 lines):
Unable to import numpy, skipping numpy extension building
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/OpenGL_accelerate
copying OpenGL_accelerate/init.py -> build/lib.linux-x86_64-3.9/OpenGL_accelerate
running build_ext
building 'OpenGL_accelerate.wrapper' extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/src
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/tmp/pip-install-8d1q8q6n/pyopengl-accelerate_955a7509e7ef40f2a3812d0a7806d532/.. -I/tmp/pip-install-8d1q8q6n/pyopengl-accelerate_955a7509e7ef40f2a3812d0a7806d532/src -I/tmp/pip-install-8d1q8q6n/pyopengl-accelerate_955a7509e7ef40f2a3812d0a7806d532 -I/usr/include/python3.9 -c src/wrapper.c -o build/temp.linux-x86_64-3.9/src/wrapper.o
src/wrapper.c:4:10: fatal error: Python.h: No such file or directory
4 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8d1q8q6n/pyopengl-accelerate_955a7509e7ef40f2a3812d0a7806d532/setup.py'"'"'; file='"'"'/tmp/pip-install-8d1q8q6n/pyopengl-accelerate_955a7509e7ef40f2a3812d0a7806d532/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-k0vm3i1r/install-record.txt --single-version-externally-managed --home /tmp/pip-target-7yvvgcr5 --compile --install-headers /tmp/pip-target-7yvvgcr5/include/python/PyOpenGL-accelerate Check the logs for full command output.
ERROR: pip install PyOpenGL_accelerate failed.
Traceback (most recent call last):
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/usr_scripts/Malt/scripts/install_dependencies.py", line 12, in
subprocess.check_call([sys.executable, '-m', 'pip', 'install', dependency, '--target', malt_dependencies_path])
File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3.9', '-m', 'pip', 'install', 'PyOpenGL_accelerate', '--target', '/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/usr_scripts/Malt/scripts/../Malt/.Dependencies-39']' returned non-zero exit status 1.
Collecting pcpp
Downloading pcpp-1.22-py2.py3-none-any.whl (82 kB)
|████████████████████████████████| 82 kB 83 kB/s
Installing collected packages: pcpp
Successfully installed pcpp-1.22
Collecting Pyrr
Downloading pyrr-0.10.3-py3-none-any.whl (46 kB)
|████████████████████████████████| 46 kB 252 kB/s
Collecting numpy
Downloading numpy-1.21.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.8 MB)
|████████████████████████████████| 15.8 MB 41 kB/s
Collecting multipledispatch
Downloading multipledispatch-0.6.0-py3-none-any.whl (11 kB)
Collecting six
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: six, numpy, multipledispatch, Pyrr
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
launchpadlib 1.10.13 requires testresources, which is not installed.
Successfully installed Pyrr-0.10.3 multipledispatch-0.6.0 numpy-1.21.1 six-1.16.0
WARNING: Target directory /home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/usr_scripts/Malt/Malt/.Dependencies-39/bin already exists. Specify --upgrade to force replacement.
Collecting psutil
Downloading psutil-5.8.0-cp39-cp39-manylinux2010_x86_64.whl (293 kB)
|████████████████████████████████| 293 kB 1.7 MB/s
Installing collected packages: psutil
Successfully installed psutil-5.8.0

So how do I get those? I tried earlier, and some of them worked, others were nowhere to be found. I think, on reflection, pip found them, but there was something else missing.

@BerlinAW
Copy link

Yeah it does look like you are missing a couple supporting packages. Odd. Perhaps there is a way to target what repo's pip looks at.

Sorry, I really don't understand too much about pip on linux mint.

@Sorry-Im-Stupid
Copy link
Author

Neither do I. Truth be told I don't really understand how any of these things work. I'm a 3D guy, code is not my area.

@BerlinAW
Copy link

I hear ya. Linux is great. I have learned so much about how computers work etc.... But at the end of the day so am I. I know enough programming and Linux system administration to make me dangerous, but I am not a programming genius.

From what I was reading online. There are a plethora of reasons why pip can't find a particular package. It will probably just take a bunch of hunting around to try and figure it out.

On the flip side of this, the developer said that they were able to get the code to work in a vanilla install on manjaro linux, on and amd laptop. I have tried it on a intel manjaro laptop that I have and had no success.

Perhaps when @BlenderNPR gets a chance to look at this thread, they could give us a few pointers.

I think I am going to call it a day. I will probably take a few more shots at this tomorrow.

@pragma37
Copy link
Member

I just tried to run Malt on Manjaro but GLFW fails to initialize due to Wayland related errors, so I couldn't go further.

I can give you some tips if you want to try again:

  1. Blender typically uses its own Python executable, so installing the libraries on your global Python environment won't have any effect. That's why the docs tell you specifically to locate the Python executable used by Blender.
  2. For some reason Blender doesn't ship with Pip on Linux, so before running the setup_blender_addon.py you have to run <Your Blender Python Path> -m ensurepip (I guess I should add this to the docs, or to the script itself).
  3. The addon should work without PyOpenGL-accelerate, but it you want to install it you need the python-dev package that matches the Blender Python version, so "Python.h" can be found.

@Sorry-Im-Stupid
Copy link
Author

Ok, I tried that, installed pip directly to the blender python.3.9, and tried again, now I'm getting different errors.

ERROR: Command errored out with exit status 1:
command: /home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/python3.9 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r4v3j7c4/pyopengl-accelerate_70725b5b21a14fd39a291a8dfe47da1f/setup.py'"'"'; file='"'"'/tmp/pip-install-r4v3j7c4/pyopengl-accelerate_70725b5b21a14fd39a291a8dfe47da1f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-13nrm_x5
cwd: /tmp/pip-install-r4v3j7c4/pyopengl-accelerate_70725b5b21a14fd39a291a8dfe47da1f/
Complete output (3 lines):
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'setuptools'

And this:

ERROR: Exception:
Traceback (most recent call last):
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/shutil.py", line 806, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/tmp/pip-target-b5x7kb32/lib/python/numpy' -> '/home/maker/Malt/Malt/.Dependencies-39/numpy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
status = self.run(options, args)
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 203, in wrapper
return func(self, options, args)
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 446, in run
self._handle_target_dir(
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 505, in _handle_target_dir
shutil.move(
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/shutil.py", line 816, in move
copytree(src, real_dst, copy_function=copy_function,
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/shutil.py", line 557, in copytree
return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/shutil.py", line 458, in _copytree
os.makedirs(dst, exist_ok=dirs_exist_ok)
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/lib/python3.9/os.py", line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/maker/Malt/Malt/.Dependencies-39/numpy'

These are new.

@Sorry-Im-Stupid
Copy link
Author

Sorry-Im-Stupid commented Jul 25, 2021

It was getting to be a mess, so I started a fresh one, and now it won't install pip...
I really hate dealing with code :(

Got pip back. Still many errors.

OK, I'm not entirely sure how, but I've managed to get everything except PYOpenGL_accelerate to install, but now it's not putting anything in the scripts folder, this is a new problem, that has always worked in the past.

Traceback (most recent call last):
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/./Malt/scripts/setup_blender_addon.py", line 59, in
ensure_dir(addons_folder)
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/./Malt/scripts/setup_blender_addon.py", line 31, in ensure_dir
os.mkdir(path)
FileNotFoundError: [Errno 2] No such file or directory: 'scripts/addons'

I've also tried it with a custom destination, same issue. Both of these folders exist, and I have told blender where they are.

Traceback (most recent call last):
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/./Malt/scripts/setup_blender_addon.py", line 59, in
ensure_dir(addons_folder)
File "/home/maker/Downloads/Blender-NPR/blender-2.93.1-linux-x64/2.93/python/bin/./Malt/scripts/setup_blender_addon.py", line 31, in ensure_dir
os.mkdir(path)
FileNotFoundError: [Errno 2] No such file or directory: 'usr-scripts/addons'

@BerlinAW
Copy link

BerlinAW commented Jul 29, 2021

Just to follow up on all this.

I was able to get the plugin to compile properly. After doing all of the steps in the docs. Blender was failing to load the plugin. The error lead me to believe that the Bridge and Malt C libraries didn't compile for some odd reason. Turns out that my system didn't have cmake installed on it. So I just downloaded it and compiled the C code using the standard cmake, make, make install operation and now the plugin loads flawlessly.

Now onto the bad news. When I try to load the shader I am back to the whole "invalid token" errors as cited above. In other words compiling the C code locally on my machine did not solve the problem.

So it has to be some odd implementation of OpenGL by the OS. Like what has been said elsewhere, right?

I am having this issue on X server. I haven't attempted to run it in wayland. Would it be better for me to do all of my testing in wayland and see if I can get GLFW running?

@pragma37 I want to help get to the bottom of this issue. It seems like a few people are struggling with this general type of problem. Can you point me in the right direction to help bug fix this? Are there some tools that I should be using to see where the issue is popping up in the driver / graphics stack? Thanks Much!

@pragma37
Copy link
Member

I tried again to run Malt in a local Manjaro installation and I couldn't figure out how to get GLFW to run.
Not even the GLFW sample code running on the system python installation.

So I can't test myself how to fix this.

However, I created a new branch for you to test with some changes:
https://github.com/bnpr/Malt/releases/tag/debug-shader-compilation-latest

44a4539

This one is using the raw OpenGL function for setting the shader source instead of the PyOpenGL wrapper, just in case the bug is there.
I also changed the formatting of the GLSL version and extension declarations.

If that doesn't help, this version also prints the processed shader source in the console, so it should be possible to inspect if there's anything wrong there.

@Sorry-Im-Stupid
Copy link
Author

Sorry-Im-Stupid commented Jul 29, 2021

I've installed the file linked above, It installs, recognizes, and crucially it doesn't reject the glsl files!
Now I have a default cube, with a material attached, and a blank node tree. I've tried to add nodes to it, and it's telling me "No graph type selected."
If this is expected behaviour then great, I'll just have to learn how the node trees work in Malt.
Thank you for your help. If you want a full debug report, you'll have to tell me how to generate that, cause I'm not sure how to tell it to put that in the console.

I opened up the shader examples file, and it doesn't render. In the work view it's just grey, no models. And if I try to render, it just freezes.

@BerlinAW
Copy link

MaltSessionLog.txt
DebugSource-Truncated.txt

Thanks for starting up another branch on this. Attached is a truncated dump from the blender console (cleaned up at the \n \t) and the malt session log.

In short, I hit this point when loading up a shader.

Error: PRE_PASS : SHADER COMPILER ERROR :
0:3(1): error: syntax error, unexpected invalid token
SHADER COMPILER ERROR :
0:3(1): error: syntax error, unexpected invalid token
SHADER LINKER ERROR :
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shaderMAIN_PASS : SHADER COMPILER ERROR :
0:3(1): error: syntax error, unexpected invalid token
SHADER COMPILER ERROR :
0:3(1): error: syntax error, unexpected invalid token
SHADER LINKER ERROR :
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shaderSHADOW_PASS : SHADER COMPILER ERROR :
0:3(1): error: syntax error, unexpected invalid token
SHADER COMPILER ERROR :
0:3(1): error: syntax error, unexpected invalid token
SHADER LINKER ERROR :
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader

Glad "Sorry" was able to make some traction on the issue.

Hopefully the above info proves somewhat useful.

@Sorry-Im-Stupid
Copy link
Author

Where did you find those files? Did you tell blender to make them?

@pragma37
Copy link
Member

@BerlinAW
Try the latest update. I think this time it may work?
https://github.com/bnpr/Malt/releases/tag/debug-shader-compilation-latest

This time I only need the logs.

@Sorry-Im-Stupid
Please, open the nodes example and post the log file.

@Sorry-Im-Stupid
Copy link
Author

Sorry-Im-Stupid commented Jul 31, 2021

Ok, I opened the nodes example, and I have something now!
NPR blender Something

I'm not finding the log file anywhere though, where should it be?
In the console all I'm getting is this:

PYTHON INTERACTIVE CONSOLE 3.9.2 (default, Feb 25 2021, 12:19:39) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]

Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bpy.utils, bgl, blf, mathutils
Convenience Imports: from mathutils import *; from math import *
Convenience Variables: C = bpy.context, D = bpy.data

Which I'm pretty sure is not relevant.

Finally made some progress learning how the malt node system works! It does crash sometimes, but doesn't crash blender, so I don't lose anything. But I did have to restart blender to get it back.
Test mat Malt

I still can't find the output log files you want. I don't think it's making them, or it's planting them in a folder outside the blender core folders.
Best I've found is this file in /tmp
malt 2021-07-31(18-43).log

@pragma37
Copy link
Member

pragma37 commented Aug 3, 2021

@Sorry-Im-Stupid
Yes, that's the log file. It's explained in the readme:
https://github.com/bnpr/Malt#bug-reports
You should disable the Debug Mode in the addon settings, btw.

Glad you got it to work.
Now let see if we can solve it in a way that can be merged in the main versions.

Could you try the latest Development version and tell me if it works for you?
https://github.com/bnpr/Malt/releases/tag/Development-latest

@Sorry-Im-Stupid
Copy link
Author

Nope, same problem we started with. Doesn't compile the glsl files.
Since the files in tmp are the ones you want, here's the one from this latest failure.

malt 2021-08-03(18-03).log

@BerlinAW
Copy link

BerlinAW commented Aug 3, 2021

@pragma37 Sorry I was away for a while.

I can confirm that malt is working for me now. I am able to load the glsl files.

image

I will put it through the paces and see what I can do with it.

At first blush, the interface, both the 3D viewport and properties panel respond a sluggishly. As I have been reading from the other threads, it is a different problem. But otherwise, hurray, it lives! Thanks for looking into this. Let me know if you need to see any more logs etc relating to this issue...

@BerlinAW
Copy link

BerlinAW commented Aug 4, 2021

Nope, same problem we started with. Doesn't compile the glsl files.
Since the files in tmp are the ones you want, here's the one from this latest failure.

malt 2021-08-03(18-03).log

If you want to see the current readout / logs from blender, I would recommend launching blender from terminal. It should give you the blow by blow reports on everything blender is doing.

If you have never done it before. When you load up the terminal or gnome terminal application on your computer and simply type in "blender" and then hit enter. You can copy and paste (ctrl-shift-c) any of the text out of that and paste it into a text file.

Otherwise to get the malt log. You can simply go into the edit > preferences > add-ons section and pull up the malt plugin. From there you can get to a quick button to pull up the malt session log.

Hope that helps.

@pragma37
Copy link
Member

pragma37 commented Aug 9, 2021

@BerlinAW
Is only the debug-shader-compilation branch working for you? Or the development branch too?

@Sorry-Im-Stupid
At this point, I can only assume your driver's shader compiler is not compliant with the standard.
The only reasonable workaround would be using the GLSLang compiler instead.
I'll update this thread once I publish the changes, but it may take a while.

@BerlinAW
Copy link

BerlinAW commented Aug 10, 2021

I just downloaded a fresh development-branch zip (f70267d). It is certainly not the development branch.... Malt loads,however I am now showing compile problems when attempting to load .glsl files.

Debug branch works. Release e8be159
However I have lag and the graphics card to 100% issue as talked about here: issues/89#issuecomment-892286932

@pragma37 pragma37 added the Linux label Oct 4, 2021
@pragma37
Copy link
Member

pragma37 commented Oct 4, 2021

This should be already fixed on the Development branch.
I added code to check what's the level of line directives support and adapt the shader source code.

The issue with AMD drivers was caused by specific characters on the line directive path.

@pragma37 pragma37 closed this as completed Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants