Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16556 Discussions

Quartus failed to run inside Docker (Linux)

Altera_Forum
Honored Contributor II
4,881 Views

Hello! 

I'm trying to implement our small automated testing & build system inside company. To do so, we decided to use Docker and Debian 8.x as base image. I'm able to build my simple demo project completely from command line (without X11) in pure Debian 8.x in virtual machine. However Quartus 17.x (free edition) inside "Docker version 17.06.2-ce, build cec0b72" fails in quartus_map: 

Info (290000): Processing of the Quartus Prime software Version 17.0.0 Build 595 04/25/2017 SJ Lite Edition started at time 09/06/2017 09:35:47 Info: ******************************************************************* Info: Running Quartus Prime Analysis & Synthesis Info: Version 17.0.0 Build 595 04/25/2017 SJ Lite Edition Info: Processing started: Wed Sep 6 09:35:48 2017 Info: Command: quartus_map --read_settings_files=on --write_settings_files=off test_autobuild -c test_autobuild *** Error in `quartus_map': free(): invalid pointer: 0x00007f50beec49a0 *** Error (293007): Current module quartus_map ended unexpectedly. Verify that you have sufficient memory available to compile your design. You can view disk space and physical RAM requirements on the System and Software Requirements page of the Intel FPGA website (http://dl.altera.com/requirements/). 

GDB says it crash here (please, take a look into quartus_map_gdb_failed.txt attached). Also tried Ubuntu 14.04.5 LTS as base image for Docker with same result. It looks like fail in udev subsystem when license manager attempts to check host id (network card is presented inside Docker as eth0). Or should I directly tell to Quartus that I'm using free version and license check is not needed? 

 

I understand that these distributions is not supported and using them at my own risk, anyway Quartus runs fine on top, unfortunately not inside Docker versions. Installation of Quartus itself in text mode inside Docker runs fine.
5 Replies
Altera_Forum
Honored Contributor II
2,850 Views

Greetings! 

 

I spent a couple days chewing on this, and eventually found https://github.com/chriz2600/quartus-lite. The interesting thing about their implementation is that they're using tcmalloc (http://goog-perftools.sourceforge.net/doc/tcmalloc.html) instead of the stock malloc, which is unusual enough that I had to try it. Sure enough, installing libtcmalloc-minimal4 and then LD_PRELOADing it did the trick: 

 

export LD_PRELOAD=/usr/lib/libtcmalloc_minimal.so.4 ${QUARTUS_PATH}/nios2eds/nios2_command_shell.sh ./build.sh -r ${_revision} -s ${_size}  

 

I've also found it beneficial(?) to delete ${QUARTUS_PATH}/quartus/linux64/libboost_system.so, libccl_curl_drl.so, and libstdc++.so.6, leaving it to use the stock Ubuntu versions instead (which are installed by the build-essential package, I believe). This is mostly because of suggestions for solving another error: 

 

Inconsistency detected by ld.so: dl-close.c: 811: _dl_close: Assertion `map->l_init_called' failed!  

 

Hopefully this is useful information! Everything is working great with Quartus 17.0 for me, so far.
0 Kudos
Altera_Forum
Honored Contributor II
2,850 Views

 

--- Quote Start ---  

Greetings! 

I spent a couple days chewing on this 

Hopefully this is useful information! Everything is working great with Quartus 17.0 for me, so far. 

--- Quote End ---  

 

 

Hello! 

I forgot about my topic here, actually I solved my problem too. The reason was null MAC address of virtual network adapter inside docker. More than this, if I set null MAC address this problem also observable inside Virtual Box.
0 Kudos
Altera_Forum
Honored Contributor II
2,850 Views

Thanks that's very helpful. Jonathan.

0 Kudos
Altera_Forum
Honored Contributor II
2,850 Views

 

--- Quote Start ---  

I ... eventually found https://github.com/chriz2600/quartus-lite. The interesting thing about their implementation is that they're using tcmalloc (http://goog-perftools.sourceforge.net/doc/tcmalloc.html) instead of the stock malloc, which is unusual enough that I had to try it. Sure enough, installing libtcmalloc-minimal4 and then LD_PRELOADing it did the trick: 

 

export LD_PRELOAD=/usr/lib/libtcmalloc_minimal.so.4 ${QUARTUS_PATH}/nios2eds/nios2_command_shell.sh ./build.sh -r ${_revision} -s ${_size}  

 

--- Quote End ---  

 

 

This worked for me too, using an Ubuntu 16.04 Docker image. Thank you for letting us know - you've saved me a lot of time.
0 Kudos
JGurn
Beginner
2,850 Views

It appears that there is an X11 feature that Quartus uses that requires a native or 3d accelerated Xserver to run. There is apparently some error recovery code that frees an invalid pointer when the resource fails to allocate, and by using tcmalloc, it ignores it.

 

The reason I believe this is the issue is that when running under VirtualBox, when I had 3d acceleration enabled it would run fine natively, but get the free(): invalid pointer when run over an ssh -X tunnel. When I disabled 3d acceleration (because there are some redraw issues w/ it), I got the same issues when run natively. LD_PRELOAD'ing tcmalloc fixed it both when running w/o 3d acceleration enabled and over an ssh -X tunnel.

0 Kudos
Reply