Workaround for cuda with system gcc-9

Open
#26 · Created  · Last updated

Description

Problem

Ubuntu 20.04 ships with gcc version 9 by default. However, cuda is only compatible with gcc up to version 8. We can expect this problem to get worse in the future, if cuda is not updated accordingly.

Solution

In the case of compiling with GPU=1, i.e. with using nvcc, fall back to a lower version of gcc.

The proposed change checks for the combination cuda + gcc-9 and prints an error if no older compiler is found (otherwise there will be an error by nvcc later in the make process).

In the case there is an older version installed on the system, it create a new hidden directory .bin_gcc, adds this to the front of the PATH variable inside the makefile and symlinks the older gcc version to .bin_gcc. This way, the older gcc version is preferred and compilation succeeds.

Testing

Different scenarios have been tested on Ubuntu workstations and servers.

 

0 attachments

0 comments

Loading commits...