PyCam and pypy

More
03 Sep 2014 06:51 - 03 Sep 2014 06:53 #50657 by rythmnbls
PyCam and pypy was created by rythmnbls
I've been playing around a bit with PyCAM-0.5.1 which works nicely but is very slow particularly with the 'carve contour' process.

Googling around a bit lead me to this site
It mentions running pycam under the JIT compiler environment of pypy. The results are very encouraging.

Here are the pycam event logs of two runs with the default bundled stl file. The only changes made were to select the cylindrical tool for the semi-finish process.

The first is running pycam normally, the second is running it in client server mode with the server running under pypy.
17:00 INFO Psyco is not available (performance will probably suffer slightly)
17:00 INFO Enabled 8 parallel local processes
17:00 INFO Font directory: /usr/share/pycam/fonts
17:00 INFO Imported STL model: 839 vertices, 0 edges, 1444 triangles
17:00 INFO Toolpath generation time: 19.595219
18:12 INFO Toolpath generation time: 4274.207707
18:15 INFO Toolpath generation time: 222.276576


18:17 INFO Psyco is not available (performance will probably suffer slightly)
18:17 INFO Enabled 0 parallel local processes
18:17 INFO Allow remote processing
18:17 INFO Connected to a remote task server.
18:17 INFO Font directory: /usr/share/pycam/fonts
18:17 INFO Imported STL model: 839 vertices, 0 edges, 1444 triangles
18:17 INFO Toolpath generation time: 16.340497
18:22 INFO Toolpath generation time: 305.309825
18:23 INFO Toolpath generation time: 34.829120

The test machine is a core i7 with 6GB ram.

My command line to launch the server was ...
pypy pycam --start-server-only --server-auth-key=test --number-of-processes=8

The command to launch the gui
pycam --enable-server --remote-server=localhost --server-auth-key=test --number-of-processes=0

The server was launched from a dedicated copy of pycam, ie, untar the tarball, cd to pycam-0.5.1 and enter the above command.

The version of python on this system 2.7.8 and v 2.3.1 of pypy was used

Hopefully others can duplicate.

Regards.

Steve.
Last edit: 03 Sep 2014 06:53 by rythmnbls.

Please Log in or Create an account to join the conversation.

More
20 Sep 2015 03:53 - 20 Sep 2015 05:11 #62797 by rythmnbls
Replied by rythmnbls on topic PyCam and pypy
There's been a bit of discussion of CAM software on the mailing list, so in light of that here's my PyCam launch script for those interested in giving PyCam + pypy a try.

It a bit rough and ready and doesn't do any checking, use at your own risk and all that :)
#!/bin/sh
#
# script to launch pycam in client server mode with the server running under pypy
# this setup gives an ~20x performance increase when running with pypy-2.6
# see http://www.pypy.org
# Start the server, fork it into the background and save it's pid into $PID
#
# 
#
CPUS=8
#
# 
#
cd $HOME/pycam-srv
pypy pycam --start-server-only --server-auth-key=test --number-of-processes=$CPUS --disable-psyco &
PID=$!
#
# Start the client, when the client exits, kill off the server and exit.
#
cd $HOME
pycam --enable-server --remote-server=localhost --server-auth-key=test --number-of-processes=0
kill -INT $PID
exit 0

Regards,

Steve.
Last edit: 20 Sep 2015 05:11 by rythmnbls.

Please Log in or Create an account to join the conversation.

More
13 Apr 2018 13:22 #108944 by skrap58
Replied by skrap58 on topic PyCam and pypy
Hi Steve,

Thank you for your posts regarding pypy and pycam. I am very interested in getting this to work. So far I have done everything on my cnc mill with opensource free software which has always been my goal. I am having trouble getting pycam to run client server mode under pypy.

Python 2.7.13 (5.8.0+dfsg-2, Jun 16 2017, 22:57:18)
[PyPy 5.8.0 with GCC 6.3.0 20170519] on linux2

Above are my versions of Python and PyPy. I have PyCam 0.5.1 working on Ubuntu but as you know well it is very slow. This is what I have in terminal when trying your start up script


wwp@desktop:~/.pycam$ pypy pycam --start-server-only --server-auth-key=test --number-of-processes=$CPUS --disable-psyco &
[1] 7380
wwp@desktop:~/.pycam$ PID=$!IOError: [Errno 2] No such file or directory: 'pycam'

This is when running from /home.

wwp@desktop:~$ pypy pycam --start-server-only --server-auth-key=test --number-of-processes=$CPUS --disable-psyco &
[1] 7625
wwp@desktop:~$ IOError: [Errno 2] No such file or directory: 'pycam'

I am by no means a developer but I am proficient with Linux OS's and willing to learn. If you could point me in the right direction I am willing to help get this working for all of us interested in this method.

Thanks

Bill
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
13 Apr 2018 22:27 #108977 by tommylight
Replied by tommylight on topic PyCam and pypy
That is nothing short of impressive !
This is the first time i see this post, and that is a huge improvement in time saving.
That would be very useful to a lot of people, for sure.

Please Log in or Create an account to join the conversation.

Moderators: Skullworks
Time to create page: 0.073 seconds
Powered by Kunena Forum