ubuntu - Segfault while trying to compile R 3.2.1 with ACML math library when using proprietary NVIDIA driver -


running ubuntu 14.04, trying compile r acml math library, , error:

byte-compiling package 'grdevices'   *** caught segfault *** address (nil), cause 'memory not mapped'   *** caught segfault *** address (nil), cause 'memory not mapped'  traceback:  1: solve.default(rgb)   *** caught segfault *** address (nil), cause 'memory not mapped'  2: solve(rgb)  3: drop(whitexyz %*% solve(rgb))  4: make.rgb(red = c(0.625, 0.34), green = c(0.28, 0.595), blue = c(0.155,     0.07), gamma = 1.8, white = "d65", name = "apple rgb")  5: eval(expr, envir, enclos)  6: eval(exprs[i], envir)  7: sys.source(codefile, env, keep.source = keep.source)  8: dotrycatch(return(expr), name, parentenv, handler)  9: trycatchone(expr, names, parentenv, handlers[[1l]]) 10: trycatchlist(expr, classes, parentenv, handlers) 11: trycatch(expr, error = function(e) {    call <- conditioncall(e)    if (!is.null(call)) {        if (identical(call[[1l]], quote(dotrycatch)))             call <- sys.call(-4l)        dcall <- deparse(call)[1l]        prefix <- paste("error in", dcall, ": ")        long <- 75l        msg <- conditionmessage(e)        sm <- strsplit(msg, "\n")[[1l]]        w <- 14l + nchar(dcall, type = "w") + nchar(sm[1l], type = "w")        if (is.na(w))             w <- 14l + nchar(dcall, type = "b") + nchar(sm[1l],                 type = "b")        if (w > long)             prefix <- paste0(prefix, "\n  ")    }    else prefix <- "error : "    msg <- paste0(prefix, conditionmessage(e), "\n")    .internal(seterrmessage(msg[1l]))    if (!silent && identical(getoption("show.error.messages"),         true)) {        cat(msg, file = stderr())        .internal(printdeferredwarnings())    }    invisible(structure(msg, class = "try-error", condition = e))}) 12: try(sys.source(codefile, env, keep.source = keep.source)) 13: loadnamespace(package, lib.loc, keep.source, partial = true) 14: withcallinghandlers(expr, packagestartupmessage = function(c) invokerestart("mufflemessage")) 15: suppresspackagestartupmessages(loadnamespace(package, lib.loc,     keep.source, partial = true)) 16: code2lazyloaddb(package, lib.loc = lib.loc, keep.source = keep.source,     compress = compress) 17: tools:::makelazyloading("grdevices") aborting ...  traceback:  1: solve.default(rgb)  2: solve(rgb)  3: drop(whitexyz %*% solve(rgb))  4: make.rgb(red = c(0.625, 0.34), green = c(0.28, 0.595), blue = c(0.155,     0.07), gamma = 1.8, white = "d65", name = "apple rgb")  5: eval(expr, envir, enclos)  traceback:  1: solve.default(rgb)  2: solve(rgb)  3: drop(whitexyz %*% solve(rgb))  4: make.rgb(red = c(0.625, 0.34), green = c(0.28, 0.595), blue = c(0.155,     0.07), gamma = 1.8, white = "d65", name = "apple rgb")  5: eval(expr, envir, enclos)  6: eval(exprs[i], envir)  7: sys.source(codefile, env, keep.source = keep.source)  8: dotrycatch(return(expr), name, parentenv, handler)  9: trycatchone(expr, names, parentenv, handlers[[1l]]) 10: trycatchlist(expr, classes, parentenv, handlers) 11: trycatch(expr, error = function(e) {    call <- conditioncall(e)    if (!is.null(call)) {        if (identical(call[[1l]], quote(dotrycatch)))             call <- sys.call(-4l)        dcall <- deparse(call)[1l]        prefix <- paste("error in", dcall, ": ")        long <- 75l        msg <- conditionmessage(e)        sm <- strsplit(msg, "\n")[[1l]]        w <- 14l + nchar(dcall, type = "w") + nchar(sm[1l], type = "w")        if (is.na(w))             w <- 14l + nchar(dcall, type = "b") + nchar(sm[1l],                 type = "b")        if (w > long)             prefix <- paste0(prefix, "\n  ")    }    else prefix <- "error : "    msg <- paste0(prefix, conditionmessage(e), "\n")    .internal(seterrmessage(msg[1l]))    if (!silent && identical(getoption("show.error.messages"),         true)) {        cat(msg, file = stderr())        .internal(printdeferredwarnings())    }    invisible(structure(msg, class = "\n  ", condition = e))})  6: eval(exprs[i], envir) 12: try(sys.source(codefile, env, keep.source = keep.source)) 13:  7: sys.source(codefile, env, keep.source = keep.source)  8: dotrycatch(return(expr), name, parentenv, handler)  9: trycatchone(expr, names, parentenv, handlers[[1l]]) 10: trycatchlist(expr, classes, parentenv, handlers) loadnamespace(package, lib.loc, keep.source, partial = true) 11: trycatch(expr, error = function(e) {    call <- conditioncall(e)14: withcallinghandlers(expr, packagestartupmessage = function(c) invokerestart("mufflemessage")) 15: suppresspackagestartupmessages(loadnamespace(package, lib.loc,     keep.source, partial = true)) 16: code2lazyloaddb(package, lib.loc = lib.loc, keep.source = keep.source,     compress = compress) 17: tools:::makelazyloading("grdevices")     if (!is.null(call)) {        if (identical(call[[1l]], quote(dotrycatch)))             call <- sys.call(-4l)        dcall <- deparse(call)[1l]aborting ...         prefix <- paste("error in", dcall, ": ")        long <- 75l        msg <- conditionmessage(e)        sm <- strsplit(msg, "\n")[[1l]]        w <- 14l + nchar(dcall, type = "w") + nchar(sm[1l], type = "w")        if (is.na(w))             w <- 14l + nchar(dcall, type = "b") + nchar(sm[1l],                 type = "b")        if (w > long)             prefix <- paste0(prefix, "\n  ")    }    else prefix <- "error : "    msg <- paste0(prefix, conditionmessage(e), "\n")    .internal(seterrmessage(msg[1l]))    if (!silent && identical(getoption("show.error.messages"),         true)) {        cat(msg, file = stderr())        .internal(printdeferredwarnings())    }    invisible(structure(msg, class = "try-error", condition = e))}) 12: try(sys.source(codefile, env, keep.source = keep.source)) 13: loadnamespace(package, lib.loc, keep.source, partial = true) 14: withcallinghandlers(expr, packagestartupmessage = function(c) invokerestart("mufflemessage")) 15: suppresspackagestartupmessages(loadnamespace(package, lib.loc,     keep.source, partial = true)) 16: code2lazyloaddb(package, lib.loc = lib.loc, keep.source = keep.source,     compress = compress) 17: tools:::makelazyloading("grdevices") aborting ... /bin/bash: line 8: 54105 done                    echo "tools:::makelazyloading(\"grdevices\")"      54106 segmentation fault      (core dumped) | r_compile_pkgs=1 r_compiler_suppress_all=1 r_default_packages=null lc_all=c ../../../bin/r --vanilla --slave > /dev/null 

i configured ./configure --with-blas=-lacml_mp --with-lapack --enable-r-shlib

i running proprietary nvidia graphics card driver, seems thing causing problem, though have no idea how. here results of other attempts @ compilation:

  • using open source nouveau driver, compiles fine (but need use proprietary nvidia driver other reasons)
  • if leave out --with-blas=-lacml_mp --with-lapack can compile fine nvidia driver
  • the same thing happens r 3.2.0

also, libacml_mp.so in right place, problem isn't linking -- can compile , link fine nouveau driver.

my guess hopeless, either have use nouveau driver or else have find other blas/lapack implementation use. if has idea what's going on here greatful.

i think acml libraries aimed @ opencl on amd gpus, although still piecing together. whole thing in flux, , see acml being retired in favour of open source alternatives. see message @ top of http://developer.amd.com/tools-and-sdks/archive/amd-core-math-library-acml/ .

as have nvidia graphics card, won't have flgrx installed, had thought pre-requisite acml. have amd cpu, , why chose acml libraries?

i recommend not using acml @ all. curious why you're compiling r link directly against library: it's easier use generic interface provided interface libblas.so.3, can switch blas without recompiling r. way, can runtime errors more quickly...

acml has never worked r me, , i'm tempted blame closed source nature, , multiple fglrx/acml/graphics card version hell.


Comments