Skip to content

Conversation

@cdai2
Copy link
Contributor

@cdai2 cdai2 commented Jul 27, 2021

…m CUDA_VISIBLE_DEVICES.

OPENCL_VISIBLE_DEVICES=descriptor_list
descriptor_list -> descriptor | descriptor::descriptor_list
descriptor -> driver,platform | driver,platform,type | driver,platform,type,device_list
device_list -> device_id | device_id,device_list
driver: client driver (foo.icd or foo.so)
platform: platform ID
type: gpu, cpu, accelerator, custom, or any
device_id: device ID in the platform

This patch is to land #45 again.
Most of the code is from pull request 45.

e.g., OPENCL_VISIBLE_DEVICES=foo.icd,0,gpu,0,1::bar.icd,1,cpu,0 only shows

  • GPU 0, 1 in the first platform of foo.icd
  • CPU 0 in the second platform of bar.icd

…m CUDA_VISIBLE_DEVICES.

OPENCL_VISIBLE_DEVICES=descriptor_list
descriptor_list -> descriptor | descriptor::descriptor_list
descriptor -> driver,platform | driver,platform,type | driver,platform,type,device_list
device_list -> device_id | device_id,device_list
driver: client driver (foo.icd or foo.so)
platform: platform ID
type: gpu, cpu, accelerator, custom, or any
device_id: device ID in the platform

This patch is to land KhronosGroup#45 again.
Most of the code is from pull request 45.

e.g., OPENCL_VISIBLE_DEVICES=foo.icd,0,gpu,0,1::bar.icd,1,cpu,0 only shows
- GPU 0, 1 in the first platform of foo.icd
- CPU 0 in the second platform of bar.icd
Copy link
Contributor

@jenatali jenatali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that this would be more appropriate as a layer, now that those are available, rather than building it straight into the loader, but perhaps someone with more expertise on layers would like to comment.

num_devices);
#endif // defined(CL_ENABLE_LAYERS)
KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(platform, CL_INVALID_PLATFORM);
return platform->dispatch->clGetDeviceIDs(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a generated file. You don't want to modify this, you want to modify the generator.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry. I closed this PR by mistake and I created PR 153. Please review.
I updated the icd_dispatch_generated.c file.

@cdai2 cdai2 closed this Aug 2, 2021
@cdai2 cdai2 deleted the enable_visible_device branch August 2, 2021 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants