cdeterman / gpuR

R interface to use GPU's
241 stars 26 forks source link

deviceHasDouble : The device device_index on platform platform_index does not support double. #56

Closed Tullio-DH closed 7 years ago

Tullio-DH commented 7 years ago

Hello,

following your advice on another thread (#55) on issues with gpuMatrix, I installed gpuR from github, with

devtools::install_github('cdeterman/gpuR')

I'm still getting an error with gpuMatrix though, although a different one:

gpuA <- gpuMatrix(rnorm(16), nrow=4, ncol=4) Error in .local(data, nrow, ncol, type, ...) : deviceHasDouble : The device device_index on platform platform_index does not support double. Try setting type = 'float' or change device if multiple available. [1] FALSE

Seems like I need to explicitly state:

gpuA <- gpuMatrix(rnorm(16), nrow=4, ncol=4, type="float")

I wonder if this could be set automatically?

This doesn't seem like a double of issue (#11) , cause I get the "correct" (I think) output on

deviceHasDouble() [1] FALSE

For completeness, here is the output of

gpuInfo() $deviceName [1] "Iris Pro"

$deviceVendor [1] "Intel"

$numberOfCores [1] 40

$maxWorkGroupSize [1] 512

$maxWorkItemDim [1] 3

$maxWorkItemSizes [1] 512 512 512

$deviceMemory [1] 1610612736

$clockFreq [1] 1200

$localMem [1] 65536

$maxAllocatableMem [1] 402653184

$available [1] "yes"

$deviceExtensions [1] "cl_APPLE_SetMemObjectDestructor" "cl_APPLE_ContextLoggingFunctions"
[3] "cl_APPLE_clut" "cl_APPLE_query_kernel_names"
[5] "cl_APPLE_gl_sharing" "cl_khr_gl_event"
[7] "cl_khr_global_int32_base_atomics" "cl_khr_global_int32_extended_atomics" [9] "cl_khr_local_int32_base_atomics" "cl_khr_local_int32_extended_atomics" [11] "cl_khr_byte_addressable_store" "cl_khr_image2d_from_buffer"
[13] "cl_khr_gl_depth_images" "cl_khr_depth_images"
[15] "cl_khr_3d_image_writes"

$double_support [1] FALSE

cdeterman commented 7 years ago

Yes, if you want that option set automatically there is a package variable that can be set with options. You can set the default to float with options(gpuR.default.type = "float")

Tullio-DH commented 7 years ago

Thanks! The option doesn't seem to change the default settings, however:

options(gpuR.default.type = "float") gpuA <- gpuMatrix(rnorm(16), nrow=4, ncol=4) Error in .local(data, nrow, ncol, type, ...) : deviceHasDouble : The device device_index on platform platform_index does not support double. Try setting type = 'float' or change device if multiple available. [1] FALSE

cdeterman commented 7 years ago

@Tullio-DH You are correct, that is a bug. I have just pushed a new commit to address that. Please reinstall from github and try again.

Tullio-DH commented 7 years ago

It fixed the issue, thank you!

Tullio-DH commented 7 years ago

Careful though: the bug has only been fixed for gpuMatrix, gpuVector still assumes double as default:

options(gpuR.default.type = "float") gpuParams <- gpuVector(Params_init) Error in .local(data, type, ...) : deviceHasDouble : The device device_index on platform platform_index does not support double. Try setting type = 'float' or change device if multiple available. [1] FALSE

cdeterman commented 7 years ago

@Tullio-DH thank you for noting that oversight. Please try the most recent master branch once more now.