Re: Sage's running too slowly

546 views
Skip to first unread message

Keshav Kini

unread,
Aug 31, 2012, 6:31:52 PM8/31/12
to sage-s...@googlegroups.com
Guilherme Boaviagem Ribeiro <guilherme...@gmail.com> writes:

> Hi everyone,
>
> I have installed Sage (with the file sage-5.0-disk1.vmdk) on my
> Windows 64-bits (4 GB RAM, and processor of 2.4 GHz), and it is
> already running in my Virtual Box. But it's way too slow, even for
> the simplest commands, does anyone have any idea of what could be the
> reason for this? My virtual machine is running Sage in Fedora with
> 512 MB of memory and 16 MB of video memory.

Does your processor support VT-x? (If you don't know, what is your
processor model?) Virtual machines will run considerably slower on
processors that don't support VT-x, I think.

-Keshav

----
Join us in #sagemath on irc.freenode.net !

Alex Ghitza

unread,
Aug 31, 2012, 9:48:27 PM8/31/12
to sage-s...@googlegroups.com
>> I have installed Sage (with the file sage-5.0-disk1.vmdk) on my
>> Windows 64-bits (4 GB RAM, and processor of 2.4 GHz), and it is
>> already running in my Virtual Box. But it's way too slow, even for
>> the simplest commands, does anyone have any idea of what could be the
>> reason for this? My virtual machine is running Sage in Fedora with
>> 512 MB of memory and 16 MB of video memory.

Are you using the command line interface or the Sage notebook? Also,
can you have a look at the memory situation inside the virtual machine
(for instance, using "top" from the command line)? It could be that
you are running out of RAM and are using the swap a lot, which makes
things very slow. Of course, in that case doing *anything* inside the
virtual machine would feel quite slow.

--
Best,
Alex

--
Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne
http://aghitza.org

Jori Mantysalo

unread,
Sep 1, 2012, 4:13:57 AM9/1/12
to sage-s...@googlegroups.com
On Fri, 31 Aug 2012, Guilherme Boaviagem Ribeiro wrote:

> I have installed Sage (with the file *sage-5.0-disk1.vmdk*) on my Windows
> 64-bits (4 GB RAM, and processor of 2.4 GHz), and it is already running in
> my Virtual Box. But it's way too slow, even for the simplest commands, does
> anyone have any idea of what could be the reason for this? My virtual
> machine is running Sage in Fedora with 512 MB of memory and 16 MB of video
> memory.

I would start by increasing memory to 1024 MB. Sage is not that small
application.

--
Jori M�ntysalo

David Kirkby

unread,
Sep 1, 2012, 4:58:39 AM9/1/12
to sage-s...@googlegroups.com
On 31 August 2012 21:20, Guilherme Boaviagem Ribeiro
<guilherme...@gmail.com> wrote:
> Hi everyone,
>
> I have installed Sage (with the file sage-5.0-disk1.vmdk) on my Windows
> 64-bits (4 GB RAM, and processor of 2.4 GHz), and it is already running in
> my Virtual Box. But it's way too slow, even for the simplest commands, does
> anyone have any idea of what could be the reason for this? My virtual
> machine is running Sage in Fedora with 512 MB of memory and 16 MB of video
> memory.

512 MB of RAM seems far too low to me. As someone else pointed out,
Sage is not a small program. Personally I'd look at the possibility of
shrinking the Windows partition a bit, and dual-booting with Linux.
Then you will have the full 4 GB for Sage.

I found the best way to shrink the Windows partition under Windows
Vista was to get a trial of a 3rd party parition tool. I forget what
it is, but it could defragment the disk far more than Windows could.
You also need to disable the hybernation mode temporarily, and turn
off the ability to page to disk. If you do both of them, you should be
able to shrink the partition, then install Linux.

That would be my preffered solution with only 4 GB in a laptop.

Dave

Jori Mantysalo

unread,
Sep 1, 2012, 6:38:57 AM9/1/12
to sage-s...@googlegroups.com
On Sat, 1 Sep 2012, David Kirkby wrote:

> Personally I'd look at the possibility of shrinking the Windows
> partition a bit, and dual-booting with Linux.

Or then reverse host-os and client-os: Have Linux installed on hardware
and Windows on VirtualBox inside Linux.

--
Jori M�ntysalo

Keshav Kini

unread,
Sep 1, 2012, 8:23:09 AM9/1/12
to sage-s...@googlegroups.com
Honestly I don't think it's very constructive to tell users that they
should install a different operating system in order to use Sage, and
that is basically what this dual-booting suggestion amounts to -
dual-booting is unlikely to be a very convenient way for anyone to use
Sage unless they start using the Sage-capable OS for their other
programs as well. The ability to multitask is something that everyone
assumes these days. I doubt many people are willing to reboot their
computer and do nothing but type code in Sage for a stretch of time,
then reboot again and do everything other than Sage for a stretch of
time. This doesn't make sense.

Volker Braun

unread,
Sep 1, 2012, 9:35:11 AM9/1/12
to sage-s...@googlegroups.com
Open VirtualBox, select the VM, click on Settings -> System. Give the VM more memory and CPU cores. Enable VT-x/AMD-V if your system supports it. 

To exclude any configuration issues inside the virtual machine you could try the official VirtualBox image that is for download on Sage webpage (http://www.sagemath.org/download-windows.html)

David Kirkby

unread,
Sep 1, 2012, 12:44:50 PM9/1/12
to sage-s...@googlegroups.com
On 1 September 2012 13:23, Keshav Kini <kesha...@gmail.com> wrote:

> Honestly I don't think it's very constructive to tell users that they
> should install a different operating system in order to use Sage, and
> that is basically what this dual-booting suggestion amounts to -
> dual-booting is unlikely to be a very convenient way for anyone to use
> Sage unless they start using the Sage-capable OS for their other
> programs as well. The ability to multitask is something that everyone
> assumes these days. I doubt many people are willing to reboot their
> computer and do nothing but type code in Sage for a stretch of time,
> then reboot again and do everything other than Sage for a stretch of
> time. This doesn't make sense.
>
> -Keshav

Dual booting will double the amount of RAM Sage can get. It's probably
not realistic to allocate more than 2 GB to the VM, but dual booting
will double that amount to 4 GB.

I suspect 90% of the time people are using computers is to browse the
web or read email - both of which can be done very easily from Linux,
so its not really a case of only using Sage on Linux.

Dual booting is a bit less convenient than a VM, but it will allow
significantly better performance on a laptop with limited RAM.

Dave

P Purkayastha

unread,
Sep 1, 2012, 2:39:52 PM9/1/12
to sage-s...@googlegroups.com
That's quite true. The OP should try a couple of things that have
already been mentioned:

1. enable VT-x if your processor supports it. Sometimes, virtualization
support is also turned off in the BIOS and needs to be enabled there.

2. Increase the VM memory to, say 2G or 2.5G. If your windows is windows
7, it should run just fine in the remaining about 1G+ of memory, as
long as you don't open other heavy programs.

3. Increase the number of processors, say from 1 to 2, allocated to the VM.

ObsessiveMathsFreak

unread,
Sep 2, 2012, 7:13:26 PM9/2/12
to sage-s...@googlegroups.com
If you're using the notebook interface, consider using chrome instead of firefox, as the latter is a massive memory hog when it comes to sage.

I find that sage + notebook typically needs a good 2GB of memory in order to run smoothly.


On Friday, August 31, 2012 9:20:14 PM UTC+1, Guilherme Boaviagem Ribeiro wrote:
Hi everyone,

I have installed Sage (with the file sage-5.0-disk1.vmdk) on my Windows 64-bits (4 GB RAM, and processor of 2.4 GHz), and it is already running in my Virtual Box. But it's way too slow, even for the simplest commands, does anyone have any idea of what could be the reason for this? My virtual machine is running Sage in Fedora with 512 MB of memory and 16 MB of video memory.

Thank you all in advance,

Nathann Cohen

unread,
Sep 2, 2012, 11:49:05 PM9/2/12
to sage-s...@googlegroups.com
Honestly I don't think it's very constructive to tell users that they
should install a different operating system in order to use Sage, and
that is basically what this dual-booting suggestion amounts to -
dual-booting is unlikely to be a very convenient way for anyone to use
Sage unless they start using the Sage-capable OS for their other
programs as well. The ability to multitask is something that everyone
assumes these days. I doubt many people are willing to reboot their
computer and do nothing but type code in Sage for a stretch of time,
then reboot again and do everything other than Sage for a stretch of
time. This doesn't make sense.

I totally agree with that. And I think that it is not very constructive to say that Sage supports windows either, when it requires users to install a virtual machine. 
It does not, and saying the opposite is bad avertisement. 
It supports Windows as much as any Linux software that does not support windows -- install a virtual machine and run it inside. And it convices people that Sage is hard to install, hard to use, and slower than it actually is :-P

Nathann

David Kirkby

unread,
Sep 3, 2012, 3:24:51 AM9/3/12
to sage-s...@googlegroups.com
On 3 September 2012 04:49, Nathann Cohen <nathan...@gmail.com> wrote:
>> Honestly I don't think it's very constructive to tell users that they
>> should install a different operating system in order to use Sage, and
>> that is basically what this dual-booting suggestion amounts to
>
>
> I totally agree with that. And I think that it is not very constructive to
> say that Sage supports windows either, when it requires users to install a
> virtual machine.
> It does not, and saying the opposite is bad avertisement.

I've had a few disagreements with Nathann before, but in this case I
agree with him. It's probably true that 99% of Windows software would
work on Linux if you run it under a virtual machine, but it's not true
to say it supports Linux.

I run 3 versions of Windows on my OpenSolaris machine (Windows XP
64-bit, Windows XP and Windows 7). Does it really mean all the
software I run supports OpenSolaris? I would say NO.

As a matter of interest, does this sub-domain need to exist

http://windows.sagemath.org/


Dave

Volker Braun

unread,
Sep 3, 2012, 3:49:51 AM9/3/12
to sage-s...@googlegroups.com
On Monday, September 3, 2012 4:49:05 AM UTC+1, Nathann Cohen wrote:
It supports Windows as much as any Linux software that does not support windows -- install a virtual machine and run it inside. And it convices people that Sage is hard to install, hard to use, and slower than it actually is :-P

Given the lack of fork() on windows, running Sage in a virtual machine is probably faster than running it under Cygwin. Especially if you have a modern CPU with hardware virtualization support. Also, Cygwin is 32-bit only.

 

David Kirkby

unread,
Sep 3, 2012, 4:52:28 AM9/3/12
to sage-s...@googlegroups.com
I don't doubt what you say about speed on Cygwin or the fact Cygwin is
only 32-bit. But Nathann still makes valid points.

I produce software which runs on Unix and Linux, but I never claim it
works on Windows, despite the fact I'm 99.999% sure it would compile
on a virtual machine running Linux, Solaris, OpenBSD, FreeBSD, SCO or
any Unix or Unix-like system.

Dave

Guilherme Boaviagem Ribeiro

unread,
Sep 3, 2012, 4:45:44 PM9/3/12
to sage-s...@googlegroups.com
Thank you all, guys!
Mantysalo and Braun, enable VT-x/AMD-V, adding one CPU and increasing the memory to 1024 MB worked really well, thanks!
Reply all
Reply to author
Forward
0 new messages