munkres-tensorflow icon indicating copy to clipboard operation
munkres-tensorflow copied to clipboard

Segmentation Fault

Open bkmi opened this issue 6 years ago • 2 comments

Using tensorflow-gpu binary from pip and a GeForce GTX 1080.

tensorflow == 1.12.0
g++=8.2.0
python=3.6.7

This is how I compiled and tested the hungarian.so file.

TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') )
TF_LFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') )
g++ -std=c++11 -shared hungarian.cc -o hungarian.so -fPIC ${TF_CFLAGS[@]} ${TF_LFLAGS[@]} -O2
cd test/
python -m unittest discover

Reports a segmentation fault:

2019-02-18 14:54:52.937674: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA
2019-02-18 14:54:53.186176: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties: 
name: GeForce GTX 1080 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:65:00.0
totalMemory: 10.92GiB freeMemory: 10.76GiB
2019-02-18 14:54:53.186213: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2019-02-18 14:54:58.701740: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-02-18 14:54:58.701796: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988]      0 
2019-02-18 14:54:58.701804: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0:   N 
2019-02-18 14:54:58.702092: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3353 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:65:00.0, compute capability: 6.1)
Segmentation fault

bkmi avatar Feb 18 '19 13:02 bkmi

I also tried running my own "test" making sure to avoid using the GPU, just in case. However, it failed with a segmentation fault as well.

import tensorflow as tf
import numpy as np
hungarian_module = tf.load_op_library("./hungarian.so")
ok = hungarian_module.hungarian(np.random.rand(2, 5, 5))
config = tf.ConfigProto(device_count={'GPU': 0})
    
with tf.Session(config=config) as sess:
    print(sess.run(ok))

bkmi avatar Feb 18 '19 13:02 bkmi

The repo is no longer maintained (as I have personally switched to pytorch), and it works up to tensorflow 1.0.

mbaradad avatar Feb 18 '19 16:02 mbaradad