
Hi everyone, I have another question about scripting. I decided to use the morph command over a trajectory with 200 frames (imported as separate pdb's) to make a really smooth movie. Currently, my .cxc has matchmaker #2-200 to #1; morph #1-200 frames 8 same true play false; close #1-200 (< 5 mins) hbonds #201:UNL restrict :UNL :< 5 reveal true interModel false cacheDa true coordsets true (< 5 mins) movie record supersample 4; perframe "~label; label hbondatoms" ; coordset #201 1,1593; wait 1593; ~perframe; movie encode output movie.mp4 bitrate 6000 framerate 25 (> 1 hr) The output is buttery smooth, and the hbond calculation only takes 3-4 mins even with 1600 frames. However, I have a problem with the speed of recording/emcpdomg... it's more than an hour. I found it strange since if I played the trajectory from morph using coordset/slider, it barely takes any time and is very smooth. I was wondering if there was a way to make this recording/encoding faster or to switch from cpu to gpu if that was possible (and if it would help any)? On another note, I'm experimenting with smooth_md.py script but with trajectory files instead of pdb's. I'll see which one looks better/is faster Alex Lee PhD Student Woods Research Group<https://woodsgroup.franklinresearch.uga.edu/> Department of Biochemistry & Molecular Biology Complex Carbohydrate Research Center University of Georgia 315 Riverbend Rd. Athens, GA 30602 Email: ahl63010@uga.edu Mobile: (470) 641-3884

Hi Alex, First you have to understand what is causing your movie recording to be slow. I tried it your recording and it took 20 minutes on my old 2017 iMac. Apparently you are using a very slow machine if it is taking longer than 1 hour for you. The "surface" command in your script means the surface will be recomputed for each of ~1600 frames and that is likely to take a lot of the time. If I commented out the surface and movie recording and encoding commands then the perframe/coordset lines took only 30 seconds. With the surface it took 8 minutes. Probably saving the 1600 image frames is taking a bit of time especially with "supersample 4" which is making an image 16 times bigger than the 2560 x 1440 window size, then averaging down. I doubt you would notice any difference with no supersampling and image frame save would be 16 times faster. The ffmpeg encoding on my machine used 7 threads (ran at 700% CPU) and took about 1 minute. There is no option to speed up any of this using the GPU, besides the graphics which is already running on the GPU (unless you are on Linux and have not installed a graphics driver -- use ChimeraX command "graphics driver" to check). I would expect it to run in about 10 minutes on a modern fast PC. My main tip when you are looking at performance is to put every command in your .cxc script on a separate line instead of putting many commands on one line with semi-colons. Then you can easily comment out commands by putting a "#" at the start of the line. Then you can see what is taking a long time. Tom
On Oct 16, 2023, at 8:23 AM, Alexander Hung Lee via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi everyone,
I have another question about scripting. I decided to use the morph command over a trajectory with 200 frames (imported as separate pdb's) to make a really smooth movie. Currently, my .cxc has
matchmaker #2-200 to #1; morph #1-200 frames 8 same true play false; close #1-200 (< 5 mins) hbonds #201:UNL restrict :UNL :< 5 reveal true interModel false cacheDa true coordsets true (< 5 mins) movie record supersample 4; perframe "~label; label hbondatoms" ; coordset #201 1,1593; wait 1593; ~perframe; movie encode output movie.mp4 bitrate 6000 framerate 25 (> 1 hr)
The output is buttery smooth, and the hbond calculation only takes 3-4 mins even with 1600 frames. However, I have a problem with the speed of recording/emcpdomg... it's more than an hour. I found it strange since if I played the trajectory from morph using coordset/slider, it barely takes any time and is very smooth. I was wondering if there was a way to make this recording/encoding faster or to switch from cpu to gpu if that was possible (and if it would help any)?
On another note, I'm experimenting with smooth_md.py script but with trajectory files instead of pdb's. I'll see which one looks better/is faster
Alex Lee PhD Student Woods Research Group <https://woodsgroup.franklinresearch.uga.edu/> Department of Biochemistry & Molecular Biology Complex Carbohydrate Research Center University of Georgia
315 Riverbend Rd. Athens, GA 30602 Email: ahl63010@uga.edu <mailto:ahl63010@uga.edu> Mobile: (470) 641-3884 <Experimental.cxc><pdb.zip>_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu <mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

Thanks Tom, I'm beating myself over the head right now - made a big mistake. I was running my script in an ubuntu VM with plenty of CPU but no GPU passthrough on a Windows host machine. I hard-coded the interactive portion of my script and did "runscript .py" in ChimeraX on windows... and it completed in 20 mins. T.T No wonder it took an hour. Lesson to be learned: Do the work on bare metal for best results - no VMs. Alex Lee Woods Lab ahl63010@uga.edu ________________________________ From: Tom Goddard <goddard@sonic.net> Sent: Tuesday, October 17, 2023 4:54 PM To: Alexander Hung Lee <Alexander.Lee@uga.edu> Cc: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Movie Record/Encode with GPU? You don't often get email from goddard@sonic.net. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification> [EXTERNAL SENDER - PROCEED CAUTIOUSLY] Hi Alex, First you have to understand what is causing your movie recording to be slow. I tried it your recording and it took 20 minutes on my old 2017 iMac. Apparently you are using a very slow machine if it is taking longer than 1 hour for you. The "surface" command in your script means the surface will be recomputed for each of ~1600 frames and that is likely to take a lot of the time. If I commented out the surface and movie recording and encoding commands then the perframe/coordset lines took only 30 seconds. With the surface it took 8 minutes. Probably saving the 1600 image frames is taking a bit of time especially with "supersample 4" which is making an image 16 times bigger than the 2560 x 1440 window size, then averaging down. I doubt you would notice any difference with no supersampling and image frame save would be 16 times faster. The ffmpeg encoding on my machine used 7 threads (ran at 700% CPU) and took about 1 minute. There is no option to speed up any of this using the GPU, besides the graphics which is already running on the GPU (unless you are on Linux and have not installed a graphics driver -- use ChimeraX command "graphics driver" to check). I would expect it to run in about 10 minutes on a modern fast PC. My main tip when you are looking at performance is to put every command in your .cxc script on a separate line instead of putting many commands on one line with semi-colons. Then you can easily comment out commands by putting a "#" at the start of the line. Then you can see what is taking a long time. Tom On Oct 16, 2023, at 8:23 AM, Alexander Hung Lee via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote: Hi everyone, I have another question about scripting. I decided to use the morph command over a trajectory with 200 frames (imported as separate pdb's) to make a really smooth movie. Currently, my .cxc has matchmaker #2-200 to #1; morph #1-200 frames 8 same true play false; close #1-200 (< 5 mins) hbonds #201:UNL restrict :UNL :< 5 reveal true interModel false cacheDa true coordsets true (< 5 mins) movie record supersample 4; perframe "~label; label hbondatoms" ; coordset #201 1,1593; wait 1593; ~perframe; movie encode output movie.mp4 bitrate 6000 framerate 25 (> 1 hr) The output is buttery smooth, and the hbond calculation only takes 3-4 mins even with 1600 frames. However, I have a problem with the speed of recording/emcpdomg... it's more than an hour. I found it strange since if I played the trajectory from morph using coordset/slider, it barely takes any time and is very smooth. I was wondering if there was a way to make this recording/encoding faster or to switch from cpu to gpu if that was possible (and if it would help any)? On another note, I'm experimenting with smooth_md.py script but with trajectory files instead of pdb's. I'll see which one looks better/is faster Alex Lee PhD Student Woods Research Group<https://woodsgroup.franklinresearch.uga.edu/> Department of Biochemistry & Molecular Biology Complex Carbohydrate Research Center University of Georgia 315 Riverbend Rd. Athens, GA 30602 Email: ahl63010@uga.edu<mailto:ahl63010@uga.edu> Mobile: (470) 641-3884 <Experimental.cxc><pdb.zip>_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu<mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
participants (2)
-
Alexander Hung Lee
-
Tom Goddard