NebulousLabs / Sia-GPU-Miner

A GPU Miner for Sia
MIT License
151 stars 79 forks source link

detection opencl platform problem #18

Closed ol92 closed 9 years ago

ol92 commented 9 years ago

Hello,

I have the error message Initializing...failed to get Device IDs: -1

I have two nvidia card and i believe the error is due to this : http://stackoverflow.com/questions/24200539/cant-get-my-graphics-card-device-in-opencl

The code in this miner is : // Get Platform/Device Information ret = clGetPlatformIDs(1, &platform_id, &ret_num_platforms); if (ret != CL_SUCCESS) { printf("failed to get platform IDs: %d\n", ret); exit(1); } ret = clGetDeviceIDs(platform_id, CL_DEVICE_TYPE_GPU, 1, &device_id, &ret_num_devices); if (ret != CL_SUCCESS) { printf("failed to get Device IDs: %d\n", ret); exit(1); }

If I read correctly, this means the opencl platform is supposed to be 1, but it can be another number. according to the : for(int i=0; i<num_of_platforms; i++) if(clGetDeviceIDs(&platform_id, CL_DEVICE_TYPE_GPU, 1, &device_id, &num_of_devices) == CL_SUCCESS){

ol92 commented 9 years ago

I made my comment too quickly and I don't know how to edit it. Obviously I was wrong, the code above doesn't suppose the platform id is 1 but try to find the id. I suppose the call clGetPlatformIDs doesn't return the good platform id in my system.

JoshVorick commented 9 years ago

The code on the wolfpr branch addresses this issue by allowing you to tell the program which platform id and device id you want it to use. We plan on adding support for running multiple GPUs in the same program, but for now you'll have to run two different instances of the program with different device flags.

The code will most likely be added to master tonight and a binary created soon after. Hope it fixes your problem!

DavidVorick commented 9 years ago

when you close something, you should write a little closing message.

code to fix this problem is now in master