Open hyh900220 opened 6 years ago
I suggest making a debug build -DCMAKE_BUILD_TYPE=Debug
and launching again. If it says smth about the GPU arch mismatch, see the README.
I modify the CMakeLists.txt, line 38 , "-march=native" to "-march=sandybridge", see below:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=sandybridge -Wall -Werror -DCUDA_ARCH=${CUDA_ARCH} -std=c++11 ${OpenMP_CXX_FLAGS}")
it still cannot normally run the test.py , but it can run the sample below and it can normally work.
import numpy
from matplotlib import pyplot
from libKMCUDA import kmeans_cuda
numpy.random.seed(0)
arr = numpy.empty((10000, 2), dtype=numpy.float32)
arr[:2500] = numpy.random.rand(2500, 2) + [0, 2]
arr[2500:5000] = numpy.random.rand(2500, 2) - [0, 2]
arr[5000:7500] = numpy.random.rand(2500, 2) + [2, 0]
arr[7500:] = numpy.random.rand(2500, 2) - [2, 0]
centroids, assignments = kmeans_cuda(arr, 4, verbosity=1, seed=3)
print(centroids)
pyplot.scatter(arr[:, 0], arr[:, 1], c=assignments)
pyplot.scatter(centroids[:, 0], centroids[:, 1], c="white", s=150)
Notice, my CPU is E5-1650, which CPU arch is Sandy Bridge EP, so change '-march=native' to '-march=sandybridge' can work, other CPU may not work. You need to notice your CPU arch.
Hi, @vmarkovtsev I meet the same problem: "Segmentation fault (core dumped)" When running test.py I use ubuntu 16.04, python 3.5.2 and CUDA 8.0. I tried to use pip install libKMCUDA, the log it shows
but when I try to run this sample
it shows error
so I try to build from source , the command is
and the build logs is kmcuda_build_log.txt
my CPU is E5-1650, motherboard is intel C602 chipset, 32G ddr3 ram.
Thanks!