Opened 7 years ago

Closed 7 years ago

#1852 closed defect (fixed)

Unable to render images despite nogui/offscreen

Reported by: jmsstarlight@… Owned by: Greg Couch
Priority: normal Milestone:
Component: Graphics Version:
Keywords: Cc: Elaine Meng, Tom Goddard
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

Then the next thing to try (for next time, since this is already going there) is the chimerax-bugs e-mail address.  Sorry about the problems.  I know “report a bug" was working at some time!
Elaine

> Begin forwarded message:
> 
> From: James Starlight <jmsstarlight@gmail.com>
> Subject: Re: [chimerax-users] ChimeraX python crush in no-gui mode
> Date: April 16, 2019 at 9:40:36 AM PDT
> To: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu>
> 
> Elaine,
> 
> i have got a bug while trying to report a bug :-)
> 
> Failed to send bug report. Error while sending follows:
> Traceback (most recent call last):
> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/bug_reporter/bug_reporter_gui.py",
> line 231, in submit
> errcode, errmsg, headers, body = post_multipart_formdata(BUG_HOST,
> BUG_SELECTOR, fields)
> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/bug_reporter/post_form.py",
> line 36, in post_multipart_formdata
> h = HTTPConnection(realhost)
> UnboundLocalError: local variable 'HTTPConnection' referenced before assignment
> 
> вт, 16 апр. 2019 г. в 18:11, Elaine Meng <meng@cgl.ucsf.edu>:
>> 
>> Hi Gleb/James,
>> You should use the Report a Bug dialog, not this e-mail list, when you have a bug.  Both ChimeraX and Chimera have this dialog in their Help menus, and it is also a button on the error dialog in most cases.
>> Best,
>> Elaine
>> -----
>> Elaine C. Meng, Ph.D.
>> UCSF Chimera(X) team
>> Department of Pharmaceutical Chemistry
>> University of California, San Francisco
>> 
>>> On Apr 16, 2019, at 1:30 AM, James Starlight <jmsstarlight@gmail.com> wrote:
>>> 
>>> Dear ChimeraX users!
>>> 
>>> I am using a cxc script together with the following options to run
>>> ChimeraX in no-gui mode.
>>> chimerax-daily --offscreen --nogui test.cxc
>>> 
>>> here is my scrript
>>> 
>>> # chimeraX script
>>> windowsize 800 600
>>> open ./test.pdb
>>> view; zoom 1.0; turn x 90; turn z -80;
>>> 
>>> preset 'overall look' publication
>>> color byattribute bfactor palette rainbow range 2,100
>>> 
>>> # make info
>>> 2dlab create title text "B-factors for" color red font gothic xpos .04
>>> ypos .90 size 30
>>> # options for light
>>> light depthcuestart .4 depthcueend .8; lighting full
>>> 
>>> save image ./test.png format png width  800 height  600 supersample 4
>>> transparentBackground  false
>>> 
>>> This script works fine with GUI producing very good picture but with
>>> the --nogui it gave me error:
>>> 
>>> Traceback (most recent call last):
>>> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/ChimeraX_main.py",
>>> line 699, in init
>>>   commands.run(sess, 'open %s' % arg)
>>> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/core/commands/run.py",
>>> line 31, in run
>>>   results = command.run(text, log=log)
>>> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/core/commands/cli.py",
>>> line 2616, in run
>>>   result = ci.function(session, **kw_args)
>>> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/core/commands/open.py",
>>> line 41, in open
>>>   from_database=from_database, ignore_cache=ignore_cache, **kw))
>>> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/core/commands/open.py",
>>> line 117, in open
>>>   models = handle_unknown_kw(session.models.open, paths,
>>> format=format, name=name, **kw)
>>> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/core/commands/open.py",
>>> line 62, in handle_unknown_kw
>>>   return f(*args, **kw)
>>> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/core/models.py",
>>> line 601, in open
>>>   session, filenames, format=format, name=name, **kw)
>>> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/core/io.py",
>>> line 467, in open_multiple_data
>>>   models, status = open_data(session, fspec, format=format, name=name, **kw)
>>> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/core/io.py",
>>> line 421, in open_data
>>>   models, status = open_func(*args, **kw)
>>> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/core/scripting.py",
>>> line 115, in open_command_script
>>>   run(session, text)
>>> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/core/commands/run.py",
>>> line 31, in run
>>>   results = command.run(text, log=log)
>>> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/core/commands/cli.py",
>>> line 2616, in run
>>>   result = ci.function(session, **kw_args)
>>> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/core/commands/save.py",
>>> line 61, in save
>>>   fmt.export(session, filename, fmt.nicknames[0], **kw)
>>> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/core/io.py",
>>> line 203, in export
>>>   result = self.export_func(session, path, **kw)
>>> File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-packages/chimerax/core/image.py",
>>> line 43, in save_image
>>>   raise LimitationError("Unable to render images to save them")
>>> chimerax.core.errors.LimitationError: Unable to render images to save them
>>> 
>>> could you help me how it may be fixed?
>>> 
>>> Thank you in advance!
>>> 
>>> Gleb
>> 
>> 
>> 
> 
> _______________________________________________
> ChimeraX-users mailing list
> ChimeraX-users@cgl.ucsf.edu
> Manage subscription:
> http://plato.cgl.ucsf.edu/mailman/listinfo/chimerax-users
> 


Change History (8)

comment:1 by pett, 7 years ago

Cc: Greg Couch Elaine Meng added
Component: UnassignedGraphics
Owner: set to Tom Goddard
Platform: all
Project: ChimeraX
Reporter: changed from Elaine Meng to jmsstarlight@…
Status: newassigned
Summary: Fwd: [chimerax-users] ChimeraX python crush in no-gui modeUnable to render images despite nogui/offscreen

comment:2 by Elaine Meng, 7 years ago

Resolution: fixed
Status: assignedclosed

fixed by Tom G

comment:3 by Elaine Meng, 7 years ago

Resolution: fixed
Status: closedreopened

well the bugreporting error is fixed, but not the other part

comment:4 by Tom Goddard, 7 years ago

For the failure to save an image with --offscreen, can you try it again and provide the entire output of ChimeraX not just the traceback. Below is what I get when I try it on a Linux machine. Note that the first line says "Offscreen rendering is not available" and the second line maybe it related to the problem.

[goddard@franklin ~]$ chimerax-daily --offscreen --nogui test.cxc
Offscreen rendering is not available.
module 'OpenGL.osmesa' has no attribute 'OSMESA_DEPTH_BITS'
0.00% done: Initializing core
50.00% done: Initializing bundles
100.00% done: Finished initialization
UCSF ChimeraX version: 0.9 (2019-04-16)
© 2016-2019 Regents of the University of California. All rights reserved.
Executing: open test.cxc
Executing: open 1a0m
Opening mmCIF 1a0m
Summary of feedback from opening 1a0m fetched from pdb
---
_note_ | Fetching mmCIF 1a0m from system cache:
/databases/mol/mmCIF/a0/1a0m.cif


_1a0m_ title:

1.1 angstrom crystal structure of A-conotoxin [TYR15]-epi

more info...(cxcmd:log metadata #1)


Chain information for 1a0m #1
---
Chain | Description
[A](cxcmd:select /A:1-17 "Select chain") [B](cxcmd:select /B:1-17 "Select
chain") | [α-conotoxin [TYR15]-epi](cxcmd:sequence chain #1/A#1/B "Show
sequence")


Non-standard residues in 1a0m #1
---
[NH2](cxcmd:sel :NH2 "select residue") — [amino
group](http://www.rcsb.org/ligand/NH2 "show residue info")



Executing: save test.png
Traceback (most recent call last):

File "/home/socr/a/chimera/chimerax_daily/lib/python3.7/site-packages/ChimeraX_main.py", line 699, in init

commands.run(sess, 'open %s' % arg)

File "/home/socr/a/chimera/chimerax_daily/lib/python3.7/site-packages/chimerax/core/commands/run.py", line 31, in \

run

results = command.run(text, log=log)

File "/home/socr/a/chimera/chimerax_daily/lib/python3.7/site-packages/chimerax/core/commands/cli.py", line 2631, i\

n run

result = ci.function(session, kw_args)

File "/home/socr/a/chimera/chimerax_daily/lib/python3.7/site-packages/chimerax/core/commands/open.py", line 41, in\

open

from_database=from_database, ignore_cache=ignore_cache, kw))

File "/home/socr/a/chimera/chimerax_daily/lib/python3.7/site-packages/chimerax/core/commands/open.py", line 117, i\

n open

models = handle_unknown_kw(session.models.open, paths, format=format, name=name, kw)

File "/home/socr/a/chimera/chimerax_daily/lib/python3.7/site-packages/chimerax/core/commands/open.py", line 62, in\

handle_unknown_kw

return f(*args, kw)

File "/home/socr/a/chimera/chimerax_daily/lib/python3.7/site-packages/chimerax/core/models.py", line 605, in open

session, filenames, format=format, name=name, kw)

File "/home/socr/a/chimera/chimerax_daily/lib/python3.7/site-packages/chimerax/core/io.py", line 477, in open_mult\

iple_data

models, status = open_data(session, fspec, format=format, name=name, kw)

File "/home/socr/a/chimera/chimerax_daily/lib/python3.7/site-packages/chimerax/core/io.py", line 431, in open_data

models, status = open_func(*args, kw)

File "/home/socr/a/chimera/chimerax_daily/lib/python3.7/site-packages/chimerax/core/scripting.py", line 115, in op\

en_command_script

run(session, text)

File "/home/socr/a/chimera/chimerax_daily/lib/python3.7/site-packages/chimerax/core/commands/run.py", line 31, in \

run

results = command.run(text, log=log)

File "/home/socr/a/chimera/chimerax_daily/lib/python3.7/site-packages/chimerax/core/commands/cli.py", line 2631, i\

n run

result = ci.function(session, kw_args)

File "/home/socr/a/chimera/chimerax_daily/lib/python3.7/site-packages/chimerax/core/commands/save.py", line 61, in\

save

fmt.export(session, filename, fmt.nicknames[0], kw)

File "/home/socr/a/chimera/chimerax_daily/lib/python3.7/site-packages/chimerax/core/io.py", line 213, in export

result = self.export_func(session, path, kw)

File "/home/socr/a/chimera/chimerax_daily/lib/python3.7/site-packages/chimerax/core/image.py", line 43, in save_im\

age

raise LimitationError("Unable to render images to save them")

chimerax.core.errors.LimitationError: Unable to render images to save them
[goddard@franklin ~]$

comment:5 by Tom Goddard, 7 years ago

Cc: Tom Goddard added; Greg Couch removed
Owner: changed from Tom Goddard to Greg Couch
Status: reopenedassigned

Greg Couch handles the offscreen rendering, so reassigning to him to figure out why it is not working.

comment:6 by Greg Couch, 7 years ago

Fix the patching of PyOpenGL to provide OSMesa support. That exposes a different bug -- it looks like OpenGL is being imported too early. Needs more investigation.

in reply to:  7 ; comment:7 by jmsstarlight@…, 7 years ago

here is the beginning of the error

Offscreen rendering is not available.
module 'OpenGL.osmesa' has no attribute 'OSMESA_DEPTH_BITS'
0.00% done: Initializing core
50.00% done: Initializing bundles
100.00% done: Finished initialization
UCSF ChimeraX version: 0.9 (2019-04-03)
© 2016-2019 Regents of the University of California.  All rights reserved.
Executing: open test.cxc
Executing: open ./test.pdb
_test.pdb_ title:
 **Gnomes, ROck Monsters And Chili Sauce** [[more info...]](cxcmd:log metadata
#1)


Chain information for test.pdb #1
---
Chain | Description
[ ](cxcmd:select :1-217 "Select chain") | [No description
available](cxcmd:sequence chain #1/  "Show sequence")


Executing: view
Executing: zoom 1.0
Executing: turn x 90
Executing: turn z -80
Executing: preset "'overall look'" publication
Preset expands to these ChimeraX commands: _set bg white; set silhouettes t_

Executing: color byattribute bfactor palette rainbow range 2,100
868 atoms, 217 residues, atom bfactor range 4.64 to 219
868 atoms, 217 residues, atom bfactor range 4.64 to 219
Executing: 2dlabels create title text '"B-factors for"' color red font
gothic xpos .04 ypos .90 size 30
Executing: lighting depthCueStart .4 depthCueEnd .8
Executing: lighting full
Executing: save image ./test.png format png width 800 height 600
supersample 4 transparentBackground false
Traceback (most recent call last):

ср, 17 апр. 2019 г. в 08:23, ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu>:

comment:8 by Greg Couch, 7 years ago

Resolution: fixed
Status: assignedclosed

A couple of bugs where quashed: (1) PyOpenGL wasn't loading the OSMesa library if was given an absolute path, like we do, and (2) Framebuffer() wanted context._framebufer_color_bits, so that was added to the OffScreenContext.

Note: See TracTickets for help on using tickets.