ThoughtWorksInc/Compute.scala

core dump

Closed this issue · 3 comments

Examples core dump. On windows, linux, cpu and gpu.

val t1: Tensor = Tensor(Array(Seq(1.0f, 2.0f, 3.0f), Seq(4.0f, 5.0f, 6.0f)))
println(t1)

results in

#  SIGSEGV (0xb) at pc=0x00007f149ef51350, pid=109309, tid=109478

Here is the build.sbt:

import Dependencies._

ThisBuild / scalaVersion     := "2.12.8"
ThisBuild / version          := "0.1.0-SNAPSHOT"
ThisBuild / organization     := "com.example"
ThisBuild / organizationName := "example"

lazy val root = (project in file("."))
  .settings(
    name := "compute",
    libraryDependencies += scalaTest % Test,
    libraryDependencies += "com.thoughtworks.compute" %% "cpu" % "latest.release",
    libraryDependencies += "com.thoughtworks.compute" %% "gpu" % "latest.release"
  )

// Platform dependent runtime of LWJGL core library
libraryDependencies += ("org.lwjgl" % "lwjgl" % "latest.release").jar().classifier {
  import scala.util.Properties._
  if (isMac) {
    "natives-macos"
  } else if (isLinux) {
    "natives-linux"
  } else if (isWin) {
    "natives-windows"
  } else {
    throw new MessageOnlyException(s"lwjgl does not support $osName")
  }
}
Atry commented

Latest Compute.scala is built with lwjgl 3.1.6, and latest lwjgl is not backward compatible with 3.1.6.

You can replace "org.lwjgl" % "lwjgl" % "latest.release" to "org.lwjgl" % "lwjgl" % "3.1.6" and it should not SIGSEGV any more

Atry commented

Another fix is explicitly using latest lwjgl-opencl instead of 3.1.6, which is compatible with latest LWJGL
platform dependent runtime, as described in 252eceb

It works. Thank you.