[chimerax-users] Save image error

Zhe Wang anchorwz at googlemail.com
Wed Feb 17 14:45:36 PST 2021


Hi Tom,

Thank you for your information. That's very helpful.
The cmd to produce the image at offscreen mode is like this
open test.map format ccp4
volume #1 style surface expandSinglePlane True
volume #1 step 1 level 660.
set bgColor white
lighting full
view cofr True
save image test.map_z.jpeg supersample 1 width 1200 height 1200

Based on your suggestion, I have increased the threshold with supersample
1.
It works but not showing what I expect and working around in a different
way.

King regards,
Zhe



On Tue, Feb 16, 2021 at 6:40 PM Tom Goddard <goddard at sonic.net> wrote:

> Hi Zhe,
>
>   Rendering an 800 million triangle surface is asking for trouble.  Each
> triangle takes about 24 bytes (3 integer vertex indices, vertex coordinate
> and normal vector  float values), so 19 Gbytes of memory.  Today's high-end
> graphics cards have 8 or 11 Gbytes of memory.  But the triangle data does
> not have to go on the graphics card.  The error might be a bug in the
> PyOpenGL library we use.  The exact error is "invalid value" in
>  glDrawElementsInstanced() with 2.5 billion vertices (= 3 * 800 milion).
> That number of vertices argument might be a signed 32-bit integer in which
> case its range is only -2 to 2 billion.  It is supposed to be unsigned, but
> it could be PyOpenGL handles it as signed.  You might try increasing your
> threshold a bit to get below 667 million triangles so you have less than 2
> billion triangle vertices and see if that works.
>
>   I am particularly puzzled by why you get the error saving the image, but
> apparently you do not get it when rendering to screen.  Maybe it is the
> "supersample 3" option somehow.  You might try "supersample 1"
>
>   I have a hard time imagining how an 800 million triangle surface is
> useful to look at -- your tomogram only has twice that many voxels!
> Possibly the solution is to change how you are trying to show it.
>
> Tom
>
>
> On Feb 16, 2021, at 9:18 AM, Zhe Wang <anchorwz at googlemail.com> wrote:
>
> Hi,
>
> I am trying to generate an image for a tomogram (1.6G).
> It can run through if I use a value that produces 33651412 triangles. But
> if I use my target level value, it will need 825273846 triangles and it
> threw the following error:
> (I am wondering if this is an edge case and how should that be dealt with
> if I want the image at my target level value?)
>
>
> Many thanks,
> Zhe
>
> PS: MacOS 11.01.1 with ChimeraX 0.9
>
> Executing: save image test.map_z.jpeg supersample 3 width 1200 height 1200
> Traceback (most recent call last):
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/ChimeraX_main.py",
> line 734, in init
>     commands.run(sess, 'open %s' % arg)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/commands/run.py",
> line 31, in run
>     results = command.run(text, log=log)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/commands/cli.py",
> line 2632, in run
>     result = ci.function(session, **kw_args)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/commands/open.py",
> line 64, in open
>     path_models = session.models.open(paths, format=format, name=name,
> **kw)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/models.py",
> line 604, in open
>     session, filenames, format=format, name=name, **kw)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/io.py",
> line 477, in open_multiple_data
>     models, status = open_data(session, fspec, format=format, name=name,
> **kw)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/io.py",
> line 431, in open_data
>     models, status = open_func(*args, **kw)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/scripting.py",
> line 115, in open_command_script
>     run(session, text)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/commands/run.py",
> line 31, in run
>     results = command.run(text, log=log)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/commands/cli.py",
> line 2632, in run
>     result = ci.function(session, **kw_args)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/commands/save.py",
> line 61, in save
>     fmt.export(session, filename, fmt.nicknames[0], **kw)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/io.py",
> line 213, in export
>     result = self.export_func(session, path, **kw)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/image.py",
> line 150, in save_image
>     transparent_background=transparent_background)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/graphics/view.py",
> line 434, in image
>     self.draw(c, drawings, swap_buffers = False)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/graphics/view.py",
> line 162, in draw
>     self._draw_scene(camera, drawings)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/graphics/view.py",
> line 192, in _draw_scene
>     shadow, multishadow = self._compute_shadowmaps(opaque_drawings +
> transparent_drawings, camera)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/graphics/view.py",
> line 541, in _compute_shadowmaps
>     shadow_enabled = r.shadow.use_shadow_map(camera, drawings,
> self._shadow_bounds)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/graphics/opengl.py",
> line 1272, in use_shadow_map
>     draw_depth(r, sdrawings, opaque_only = not
> r.material.transparent_cast_shadows)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/graphics/drawing.py",
> line 1413, in draw_depth
>     draw_opaque(r, drawings)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/graphics/drawing.py",
> line 1394, in draw_opaque
>     _draw_multiple(drawings, renderer, Drawing.OPAQUE_DRAW_PASS)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/graphics/drawing.py",
> line 1405, in _draw_multiple
>     d.draw(renderer, draw_pass)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/graphics/drawing.py",
> line 698, in draw
>     self.draw_self(renderer, draw_pass)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/graphics/drawing.py",
> line 705, in draw_self
>     self._draw_geometry(renderer, opaque_only = any_transp)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/graphics/drawing.py",
> line 770, in _draw_geometry
>     ds.draw(self.display_style)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/graphics/drawing.py",
> line 1575, in draw
>     eb.draw_elements(etype, ni)
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/core/graphics/opengl.py",
> line 2483, in draw_elements
>     GL.glDrawElementsInstanced(element_type, ne, GL.GL_UNSIGNED_INT, eo,
> ninst)
>   File "src/latebind.pyx", line 32, in
> OpenGL_accelerate.latebind.LateBind.__call__
>   File "src/wrapper.pyx", line 318, in
> OpenGL_accelerate.wrapper.Wrapper.__call__
>   File "src/wrapper.pyx", line 311, in
> OpenGL_accelerate.wrapper.Wrapper.__call__
>   File
> "/nfs/public/rw/pdbe/httpd-em/software/chimerax/opt/UCSF/ChimeraX/lib/python3.7/site-packages/PyOpenGL-3.1.3b2-py3.7.egg/OpenGL/platform/baseplatform.py",
> line 409, in __call__
>     return self( *args, **named )
>   File "src/errorchecker.pyx", line 53, in
> OpenGL_accelerate.errorchecker._ErrorChecker.glCheckError
> OpenGL.error.GLError: GLError(
> err = 1281,
> description = b'invalid value',
> baseOperation = glDrawElementsInstanced,
> pyArgs = (
> GL_TRIANGLES,
> 2475821538,
> GL_UNSIGNED_INT,
> None,
> 1,
> ),
> cArgs = (
> GL_TRIANGLES,
> 2475821538,
> GL_UNSIGNED_INT,
> None,
> 1,
> ),
> cArguments = (
> GL_TRIANGLES,
> 2475821538,
> GL_UNSIGNED_INT,
> None,
> 1,
> )
> )
>
> ReplyForward
> _______________________________________________
> ChimeraX-users mailing list
> ChimeraX-users at cgl.ucsf.edu
> Manage subscription:
> https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimerax-users/attachments/20210217/89a4b107/attachment.html>


More information about the ChimeraX-users mailing list