Author Topic: KiCad in a VM  (Read 6777 times)

0 Members and 1 Guest are viewing this topic.

Offline suicidaleggrollTopic starter

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
KiCad in a VM
« on: February 25, 2016, 12:01:11 am »
Is anybody else doing this?  I've found that building KiCad from scratch is such a PITA on most Linux distros, that it's better to simply use a VM running one of the few distros on which KiCad builds properly rather than having to switch the host OS.  I've been running into some annoying problems with that though.

The first is that in VirtualBox the mouse lags horribly, it's almost unusable.  I found this which describes the issue:
https://gist.github.com/tomacorp/80943ef136e37823db42

However the fix to shut off EXAPixmaps does not work for me

I then switched to VMWare, and while the mouse problem is gone, there's a new problem.  Whenever I select a group of components in either eeschema or pcbnew, the screen does not auto-refresh.  One or two components works fine, but 5+ gets no refresh.  I have to keep banging F3 as I drag the group around in order to see where it's currently at so I can drop it in the right place.

I do have a laptop running OpenSUSE Tumbleweed as the host with the same version of KiCad installed natively, and it doesn't have any of these problems, so it has to be the virtualization software.
 

Offline timofonic

  • Frequent Contributor
  • **
  • Posts: 904
  • Country: es
  • Eternal Wannabe Geek
Re: KiCad in a VM
« Reply #1 on: February 25, 2016, 12:23:39 am »
I use both Archlinux's AUR and Gentoo/Funtoo. Zero issues. What distro do you use?

I suposse Vmware is installed with the guest stuff and such. Am I right?

Maybe a developer can read this. If not, I can send it to one. You can ask in the kicad-developers mailing list too.

https://lists.launchpad.net/kicad-developers/
« Last Edit: February 25, 2016, 12:25:39 am by timofonic »
 

Offline suicidaleggrollTopic starter

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: KiCad in a VM
« Reply #2 on: February 25, 2016, 01:02:47 am »
Lots of distros at play here, let's see...

OpenSUSE Tumbleweed -> KiCad (running natively) = no problems
CentOS 6 -> VirtualBox -> Debian Unstable -> KiCad = laggy mouse
CentOS 7 -> VirtualBox -> OpenSUSE Tumbleweed -> KiCad = laggy mouse
CentOS 7 -> VMWare -> OpenSUSE Tumbleweed -> KiCad = no refresh when moving selection

and the link I posted, if you want to include it:
OSX -> VirtualBox -> Ubuntu 14.04 -> KiCad = laggy mouse

All systems and VM software up to date, guest additions installed, etc.

I'll try the mailing list if nobody here has run into this problem and has a suggested work-around.
 

Offline daybyter

  • Frequent Contributor
  • **
  • Posts: 397
  • Country: de
Re: KiCad in a VM
« Reply #3 on: February 25, 2016, 01:39:19 am »
I use a kubuntu host and mostly Debian guests for development. Due to some network issues, I also use kvm+qemu for some apps.
 

Offline eugenenine

  • Frequent Contributor
  • **
  • Posts: 865
  • Country: us
Re: KiCad in a VM
« Reply #4 on: February 25, 2016, 03:06:51 am »
What OS for the host?

I found the Kicad build pretty simple, if you want to see complex try something like mySQLWorkbench. 

https://slackbuilds.org/result/?search=kicad&sv=14.1

 
 

Offline suicidaleggrollTopic starter

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: KiCad in a VM
« Reply #5 on: February 25, 2016, 03:27:45 am »
Host OSs are in post #3

The build is simple if you're on one of the few distros which provide the necessary dependencies.  On any of the vast multitude of other distros you quickly run into dependency hell.  Try building it on Debian Stable, RHEL, CentOS, or any other server/stable distro, it's not exactly fun.

That's not really the point of this post anyway though, the point is the behavior under virtualization.  Both VirtualBox and VMWare appear to be having problems, but very different ones.  It's pretty clear to me that the laggy mouse problem is solely due to VirtualBox's interaction with KiCad.  I'm not sure yet about VMWare since I don't have a decent sample size.
« Last Edit: February 25, 2016, 03:29:53 am by suicidaleggroll »
 

Offline eugenenine

  • Frequent Contributor
  • **
  • Posts: 865
  • Country: us
Re: KiCad in a VM
« Reply #6 on: February 25, 2016, 03:47:04 am »
Sorry, missed post 3 while I was typing.  I did build it myself though, there were a whole 5 other packages I had to build, was pretty simple. 
 

Offline daybyter

  • Frequent Contributor
  • **
  • Posts: 397
  • Country: de
Re: KiCad in a VM
« Reply #7 on: February 25, 2016, 06:11:03 am »
What mouse capture strategy do you use?

Is 2d acceleration enabled in your guest?

Did you check the load of the machine with 'top' and added more RAM or CPU cores if necessary?
 

Offline suicidaleggrollTopic starter

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: KiCad in a VM
« Reply #8 on: February 25, 2016, 04:54:13 pm »
I've tried "PS/2 Mouse" and "USB Tablet" in VirtualBox, no difference.

2D acceleration in VirtualBox is only for Windows guests, it won't let me set it.  3D acceleration causes several programs in the VM to seg fault, including the terminal emulator of all things...so I leave that off.

CPU and RAM settings for the VM make no difference, it's not resource-limited.  The standard setup is 2 cores and 2 GB, I bumped it up to 4 cores and 4 GB with no change.  At idle the load is negligible on both the guest and host.  When moving the mouse the guest jumps up to about 50% CPU for kicad and 30% for Xorg (out of 400% since there are 4 cores) and the host jumps up to about 120% for virtualbox and 40% for Xorg (again out of 400%).
 

Offline suicidaleggrollTopic starter

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: KiCad in a VM
« Reply #9 on: February 25, 2016, 05:08:19 pm »
Also let me clarify a bit what I mean by the mouse is laggy.

In both eeschema and pcbnew, there are two pointers.  There's the system mouse pointer, and below that are cross-hairs that move with the pointer but snap to the grid below.  When I say the mouse lags, I'm referring to the cross-hairs only.  The system pointer is fine, it moves like normal and there's no visible lag or other problems.  The issue is the cross-hairs lag behind the pointer.  It's not jumpy or erratic, it's just slow.

It's as if whenever the mouse moves, the system pointer is filling up a buffer at 100 Hz, and kicad is pulling the positions out of that buffer at 50 Hz to update the cross-hair location.  It eventually gets to the new location of the pointer, but it moves at half the speed and takes twice as long to get there.  If you spin the mouse in circles for two seconds and then stop, the cross-hairs continue circling for an additional two seconds until they finally catch up to the final location of the pointer.  And this issue is not present at all when running the same guest OS in VMWare (but VMWare has its own problems described above).
« Last Edit: February 25, 2016, 05:11:08 pm by suicidaleggroll »
 

Offline ve7xen

  • Super Contributor
  • ***
  • Posts: 1192
  • Country: ca
    • VE7XEN Blog
Re: KiCad in a VM
« Reply #10 on: February 25, 2016, 07:42:03 pm »
I have no experience with running KiCad under VM, but the whole 2D drawing architecture seems poor. I've seen redraw issues on every hardware and software combination I've run it on; it seems to me just a fact of life using KiCad. I just got used to hitting the redraw hotkey to clean it up.

Beyond that though, it has serious issues with performance on some graphics chipsets, and I suspect this is the root of the issues under virtualization. ATI cards running the open-source driver are very slow in eeschama and especially pcbnew (except the OpenGL mode which works fine). In my experience the suggested EXAPixamps fix is only partial and still results in quite poor performance. Apparently they are using some features of X that aren't accelerated/supported by all drivers, and don't seem to intend to change them. I would guess something similar might be true of the emulated graphics drivers - or the actual rendering methodology itself is just slow or requires a lot of interaction with the hardware, and virtualizing makes it slower.
73 de VE7XEN
He/Him
 

Offline suicidaleggrollTopic starter

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: KiCad in a VM
« Reply #11 on: February 25, 2016, 07:58:22 pm »
I have no experience with running KiCad under VM, but the whole 2D drawing architecture seems poor. I've seen redraw issues on every hardware and software combination I've run it on; it seems to me just a fact of life using KiCad. I just got used to hitting the redraw hotkey to clean it up.

Beyond that though, it has serious issues with performance on some graphics chipsets, and I suspect this is the root of the issues under virtualization. ATI cards running the open-source driver are very slow in eeschama and especially pcbnew (except the OpenGL mode which works fine). In my experience the suggested EXAPixamps fix is only partial and still results in quite poor performance. Apparently they are using some features of X that aren't accelerated/supported by all drivers, and don't seem to intend to change them. I would guess something similar might be true of the emulated graphics drivers - or the actual rendering methodology itself is just slow or requires a lot of interaction with the hardware, and virtualizing makes it slower.

You might be right.  I just copied the VirtualBox VM over to a different machine and it doesn't appear to have any lag problems.  It's a newer machine, a bit faster, but the main difference is it runs Intel HD graphics that are built into the processor, versus my primary machine which has an older NVIDIA Quadro card.
 

Offline nickoe

  • Contributor
  • Posts: 24
Re: KiCad in a VM
« Reply #12 on: March 01, 2016, 09:08:55 pm »
Lots of distros at play here, let's see...

OpenSUSE Tumbleweed -> KiCad (running natively) = no problems
CentOS 6 -> VirtualBox -> Debian Unstable -> KiCad = laggy mouse
CentOS 7 -> VirtualBox -> OpenSUSE Tumbleweed -> KiCad = laggy mouse
CentOS 7 -> VMWare -> OpenSUSE Tumbleweed -> KiCad = no refresh when moving selection

and the link I posted, if you want to include it:
OSX -> VirtualBox -> Ubuntu 14.04 -> KiCad = laggy mouse

All systems and VM software up to date, guest additions installed, etc.

I'll try the mailing list if nobody here has run into this problem and has a suggested work-around.

I don't see what the problem is. The main buildserver is centos6 and that it builds just fine...

Host OSs are in post #3

The build is simple if you're on one of the few distros which provide the necessary dependencies.  On any of the vast multitude of other distros you quickly run into dependency hell.  Try building it on Debian Stable, RHEL, CentOS, or any other server/stable distro, it's not exactly fun.

[...]

You know that KiCad 4.0.2 should be available via backports in Debian Stable (Jessie)?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf