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

Failure with OpenGL.error.GLError - glTexParameteri #1024

Closed
totaam opened this issue Nov 5, 2015 · 20 comments
Closed

Failure with OpenGL.error.GLError - glTexParameteri #1024

totaam opened this issue Nov 5, 2015 · 20 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Nov 5, 2015

Issue migrated from trac ticket # 1024

component: client | priority: blocker | resolution: fixed

2015-11-05 21:23:51: markmandel created the issue


Using xpra v0.16.0 build, Ubuntu 14.04 (attached bug zip)

Works perfectly with the machine I have with an Nvidia Card. But the machine I have with just an Intel graphics card, the window will show, but the contents don't render (see screenshot).

See xpra.log for the error log from xpr client, and the :100.log for the xpra server.

@totaam
Copy link
Collaborator Author

totaam commented Nov 5, 2015

2015-11-05 21:24:18: markmandel uploaded file xpra.bug.log.zip (391.0 KiB)

xpra bug dump

@totaam
Copy link
Collaborator Author

totaam commented Nov 5, 2015

2015-11-05 21:24:35: markmandel uploaded file :100.log (169.7 KiB)

xpra server log

@totaam
Copy link
Collaborator Author

totaam commented Nov 5, 2015

2015-11-05 21:24:52: markmandel uploaded file xpra.log (49.1 KiB)

xpra client log

@totaam
Copy link
Collaborator Author

totaam commented Nov 6, 2015

2015-11-06 01:57:10: antoine changed status from new to assigned

@totaam
Copy link
Collaborator Author

totaam commented Nov 6, 2015

2015-11-06 01:57:10: antoine commented


First good catch (not solving this bug though):

failed to import swscale colorspace conversion (csc_swscale)
 No module named dec_avcodec2.decoder

is fixed in r11146.


Next we have lots of:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/xpra/client/gl/gtk2/gl_window_backing.py", line 41, in gl_expose_event
    self.gl_init()
  File "/usr/lib/python2.7/dist-packages/xpra/client/gl/gl_window_backing_base.py", line 401, in gl_init
    glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAX_LEVEL, 0)
  File "/usr/lib/python2.7/dist-packages/OpenGL/error.py", line 208, in glCheckError
    baseOperation = baseOperation,
OpenGL.error.GLError: GLError(
        err = 1281,
        description = 'invalid value',
        baseOperation = glTexParameteri,
        cArguments = (
                GL_TEXTURE_RECTANGLE_ARB,
                GL_TEXTURE_MAX_LEVEL,
                0,
        )
)

And rgb24 / rgb32 paint errors:

2015-11-05 08:10:34,584 do_paint_rgb32 error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/xpra/client/window_backing_base.py", line 309, in do_paint_rgb32
    success = (self._backing is not None) and self._do_paint_rgb32(img_data, x, y, width, height, rowstride, options)
  File "/usr/lib/python2.7/dist-packages/xpra/client/gl/gl_window_backing_base.py", line 625, in _do_paint_rgb32
    return self._do_paint_rgb(32, img_data, x, y, width, height, rowstride, options)
  File "/usr/lib/python2.7/dist-packages/xpra/client/gl/gl_window_backing_base.py", line 641, in _do_paint_rgb
    self.gl_init()
  File "/usr/lib/python2.7/dist-packages/xpra/client/gl/gl_window_backing_base.py", line 401, in gl_init
    glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAX_LEVEL, 0)
  File "/usr/lib/python2.7/dist-packages/OpenGL/error.py", line 208, in glCheckError
    baseOperation = baseOperation,
GLError: GLError(
        err = 1281,
        description = 'invalid value',
        baseOperation = glTexParameteri,
        cArguments = (
                GL_TEXTURE_RECTANGLE_ARB,
                GL_TEXTURE_MAX_LEVEL,
                0,
        )
)

The GL_TEXTURE_MAX_LEVEL=0 is actually the recommended way of turning off mipmaps in opengl, see [https://www.opengl.org/wiki/Common_Mistakes#Creating_a_complete_texture].
Sounds similar to this bug: Setting GL_TEXTURE_MAX_LEVEL to 0 fires GL_INVALID_OPERATION.

I'll try to reproduce this, but it looks like a buggy driver to me.
I'll take a look when I get a chance, in the meantime you can help by providing the output of the gl_check.py script.

@totaam
Copy link
Collaborator Author

totaam commented Nov 6, 2015

2015-11-06 04:01:44: markmandel commented


No problem at all:

➜  /tmp  ./gl_check.py
PyOpenGL warning: missing accelerate module
PyOpenGL warning: missing array format handlers: numeric, vbo, vbooffset
OpenGL Version: 3.0 Mesa 10.1.3


OpenGL properties:
* GLU extensions           : GLU_EXT_nurbs_tessellator GLU_EXT_object_space_tess
* GLU version              : 1.3
* display_mode             : ALPHA, SINGLE
* gdkgl.version            : 1.4
* gdkglext.version         : 1.2.0
* gtkglext.version         : 1.2.0
* has_alpha                : True
* max-viewport-dims        : (16384, 16384)
* opengl                   : 3.0
* pygdkglext.version       : 1.1.0
* pyopengl                 : 3.0.2
* renderer                 : Mesa DRI Intel(R) Haswell Mobile
* rgba                     : True
* safe                     : True
* shading language version : 1.30
* texture-size-limit       : 4096
* vendor                   : Intel Open Source Technology Center
* zerocopy                 : False

@totaam
Copy link
Collaborator Author

totaam commented Nov 6, 2015

2015-11-06 04:27:51: markmandel commented


Not sure if this helps - I dug into what driver that I was using:

sudo lshw -c video
[sudo] password for markmandel:
PCI (sysfs)

  --display
       description: VGA compatible controller
       product: Haswell-ULT Integrated Graphics Controller
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 0b
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:63 memory:d0000000-d03fffff memory:c0000000-cfffffff ioport:3000(size=64)

I went digging around, and found this excerpt in, not sure if it's relevent, I'm hoping it is:
http://www.intel.com/content/dam/www/public/us/en/documents/guides/efi-bios-10-3-1-users-guide.pdf

-7.6.10.2 OpenGL Use Considerations*

-Allocation of Mipmaps and Memory Usage*

Under normal circumstances the OpenGL driver will allocate all mip levels for a texture
at allocation time. This is due to the fact that the OpenGL API allows an application to
make use of the mips without first conveying an intention to do so. All mips are
therefore available all the time.
The IEGD OpenGL driver has a special-case scenario to prevent the allocation of mips
when the application can ensure that they will never be populated or used. On some
hardware configurations this can save 50% on texture memory usage. To enable this
feature, the application should do the following:
Using glTexParameter*(), set the GL_TEXTURE_MAX_LEVEL parameter to 0 before
populating the texture (before any call to glTexImage2D()). This will prevent mips 1-N
from being allocated but will not prevent them from being used. If the mips are
inadvertently used, the results are undefined.

@totaam
Copy link
Collaborator Author

totaam commented Nov 8, 2015

2015-11-08 13:23:45: antoine uploaded file level-texture2d.patch (3.9 KiB)

set the level parameter on TEXTURE_2D

@totaam
Copy link
Collaborator Author

totaam commented Nov 8, 2015

2015-11-08 13:25:06: antoine changed status from assigned to new

@totaam
Copy link
Collaborator Author

totaam commented Nov 8, 2015

2015-11-08 13:25:06: antoine changed owner from antoine to markmandel

@totaam
Copy link
Collaborator Author

totaam commented Nov 8, 2015

2015-11-08 13:25:06: antoine commented


That's odd, we do set GL_TEXTURE_MAX_LEVEL before using the textures, that's what it is failing on. Maybe with this older driver, we shouldn't be doing it?
r11150 now also sets GL_TEXTURE_BASE_LEVEL, maybe it will help.

It's not really clear to me if the invalid value is GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAX_LEVEL or 0.
Although the glTexParameter docs specify that the target texture of the active texture unit, which must be either GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP, we actually use GL_TEXTURE_RECTANGLE_ARB, but there are lots of opengl examples out there doing the exact same thing.

@markmandel: can you try the latest trunk?
And if that doesn't work, maybe try the patch attached above? Or just remove all those GL_TEXTURE_MAX_LEVEL / GL_TEXTURE_BASE_LEVEL calls.

@totaam
Copy link
Collaborator Author

totaam commented Nov 8, 2015

2015-11-08 16:22:08: markmandel commented


Sure - will take it for a spin!

This isn't anything special, just the normal xserver-xorg-video-intel driver.

If the patches don't work, I'll give xorg-edgers a try, and see how that fares as well.

@totaam
Copy link
Collaborator Author

totaam commented Nov 13, 2015

2015-11-13 07:07:59: antoine commented


This could also be due to the outdated version of pyopengl found in Ubuntu Trusty, you could try replacing the system one with one you install from upstream: [https://pypi.python.org/pypi/PyOpenGL] (you can just sudo easy_install PyOpenGL it)

@totaam
Copy link
Collaborator Author

totaam commented Nov 16, 2015

2015-11-16 07:34:53: antoine commented


@markmandel: does the new build and/or a new pyopengl help?

@totaam
Copy link
Collaborator Author

totaam commented Nov 20, 2015

2015-11-20 06:16:09: antoine commented


The same bug has been reported with Trusty and AMD cards: #1036#comment:16

Not sure how to deal with this now: maybe pyopengl is too old, or maybe we should just not support Trusty at all with 0.16

@totaam
Copy link
Collaborator Author

totaam commented Nov 27, 2015

2015-11-27 18:38:25: zenny commented


As asked in #1043#comment:5, here comes the chipset details:

[[BR]]

$ python /usr/lib/python2.7/dist-packages/xpra/client/gl/gl_check.py
PyOpenGL warning: missing accelerate module
PyOpenGL warning: missing array format handlers: numeric, vbo, vbooffset
OpenGL Version: 3.0 Mesa 10.1.3


OpenGL properties:
* GLU extensions           : GLU_EXT_nurbs_tessellator GLU_EXT_object_space_tess 
* GLU version              : 1.3
* display_mode             : ALPHA, SINGLE
* gdkgl.version            : 1.4
* gdkglext.version         : 1.2.0
* gtkglext.version         : 1.2.0
* has_alpha                : True
* max-viewport-dims        : (16384, 16384)
* opengl                   : 3.0
* pygdkglext.version       : 1.1.0
* pyopengl                 : 3.0.2
* renderer                 : Gallium 0.4 on AMD CAICOS
* rgba                     : True
* safe                     : True
* shading language version : 1.30
* texture-size-limit       : 16384
* transparency             : True
* vendor                   : X.Org
* zerocopy                 : False

$ sudo lshw -c video
SCSI                      
  --display        
       description: VGA compatible controller
       product: Caicos [Radeon HD 6450/7450/8450 / R5 230 OEM]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:01:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
       configuration: driver=radeon latency=0
       resources: irq:42 memory:d0000000-dfffffff memory:fddc0000-fdddffff ioport:ee00(size=256) memory:fdd00000-fdd1ffff

@totaam
Copy link
Collaborator Author

totaam commented Dec 5, 2015

2015-12-05 10:44:35: antoine changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Dec 5, 2015

2015-12-05 10:44:35: antoine set resolution to fixed

@totaam
Copy link
Collaborator Author

totaam commented Dec 5, 2015

2015-12-05 10:44:35: antoine commented


Closing as fixed:

  • all Intel drivers are blacklisted again
  • Ubuntu < 15 is also blacklisted

Feel free to re-open if you can reproduce with a recent version on default settings.

@totaam totaam closed this as completed Dec 5, 2015
@totaam
Copy link
Collaborator Author

totaam commented Dec 16, 2015

2015-12-16 03:38:34: antoine commented


See ClientRendering OpenGL

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

1 participant