IDSIA / brainstorm

Fast, flexible and fun neural networks.
Other
1.3k stars 152 forks source link

gcc 4.10 and up are not supported? #67

Closed pinae closed 8 years ago

pinae commented 8 years ago

I'm trying to run the mnist example on Ubuntu 15.10 on a system with a GTX970. The following error occurs:

brainstorm/examples$ python3 mnist_pi.py Traceback (most recent call last): File "mnist_pi.py", line 9, in import brainstorm as bs File "/usr/local/lib/python3.4/dist-packages/brainstorm-0.5b0-py3.4-linux-x86_64.egg/brainstorm/init.py", line 6, in from brainstorm.structure import Network, generate_architecture File "/usr/local/lib/python3.4/dist-packages/brainstorm-0.5b0-py3.4-linux-x86_64.egg/brainstorm/structure/init.py", line 4, in from brainstorm.structure.network import Network File "/usr/local/lib/python3.4/dist-packages/brainstorm-0.5b0-py3.4-linux-x86_64.egg/brainstorm/structure/network.py", line 13, in from brainstorm.handlers import default_handler File "/usr/local/lib/python3.4/dist-packages/brainstorm-0.5b0-py3.4-linux-x86_64.egg/brainstorm/handlers/init.py", line 10, in from brainstorm.handlers.pycuda_handler import PyCudaHandler File "/usr/local/lib/python3.4/dist-packages/brainstorm-0.5b0-py3.4-linux-x86_64.egg/brainstorm/handlers/pycuda_handler.py", line 580, in _mod = SourceModule(merge_kernel_code) File "/home/jonny/.local/lib/python3.4/site-packages/pycuda/compiler.py", line 259, in init__ arch, code, cache_dir, include_dirs) File "/home/jonny/.local/lib/python3.4/site-packages/pycuda/compiler.py", line 249, in compile return compile_plain(source, options, keep, nvcc, cache_dir, target) File "/home/jonny/.local/lib/python3.4/site-packages/pycuda/compiler.py", line 78, in compile_plain checksum.update(preprocess_source(source, options, nvcc).encode("utf-8")) File "/home/jonny/.local/lib/python3.4/site-packages/pycuda/compiler.py", line 55, in preprocess_source cmdline, stderr=stderr) pycuda.driver.CompileError: nvcc preprocessing of /tmp/tmpgm11a_e4.cu failed [command: nvcc --preprocess -arch sm_52 -I/home/jonny/.local/lib/python3.4/site-packages/pycuda/cuda /tmp/tmpgm11a_e4.cu --compiler-options -P] [stderr: b'In file included from /usr/local/cuda-7.0/bin/../targets/x86_64-linux/include/cuda_runtime.h:62:0,\n > from :0:\n/usr/local/cuda-7.0/bin/../targets/x86_64-linux/include/host_config.h:105:2: error: #error -- unsupported GNU version! gcc 4.10 and up are not supported!\n #error -- unsupported > GNU version! gcc 4.10 and up are not supported!\n ^\n']

I installed brainstorm as described in the README. I think Cuda is in version 7.0 but I just updated it from 6.5. gcc is in version 5.2.1. If you need any other information let me know.

flukeskywalker commented 8 years ago

This is a CUDA compatibility issue, unrelated to Brainstorm. CUDA 7.0 (and 7.5) do not support gcc > 4.9.2 See: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements For CUDA 7.0, system requirements are here: https://a248.e.akamai.net/f/248/10/10/developer.download.nvidia.com/compute/cuda/7_0/Prod/doc/CUDA_Getting_Started_Linux.pdf According to it, the recommended combination is Ubuntu 14.10 + gcc 4.9.1

Qwlouse commented 8 years ago

You could try following this hack (the part about patching the host_config.h).

pinae commented 8 years ago

As @Qwlouse suggested: skipping the check makes cuda run with gcc 5. I only had to adjust /usr/local/cuda-7.0/include/host_config.h like this:

if GNUC > 4 || (GNUC == 4 && GNUC_MINOR > 9)

//#error -- unsupported GNU version! gcc 4.10 and up are not supported!

endif /* GNUC> 4 || (GNUC == 4 && GNUC_MINOR > 9) */

Now it works. Thanks for your help!