Skip to content

Multiple directories in OCL_ICD_VENDORS #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
isuruf opened this issue Feb 17, 2019 · 8 comments
Open

Multiple directories in OCL_ICD_VENDORS #7

isuruf opened this issue Feb 17, 2019 · 8 comments

Comments

@isuruf
Copy link

isuruf commented Feb 17, 2019

I wanted to add a feature such that ocl-icd can look at multiple directories to find icds. For that I'm thinking of using OCL_ICD_VENDORS env variable with a colon separated list of directories like PATH env variable.

If you agree that this is useful, I can send a PR.

@isuruf
Copy link
Author

isuruf commented Mar 8, 2019

ping

@Kerilk
Copy link
Contributor

Kerilk commented Sep 13, 2020

Thanks for the suggestion, that is something I am looking into.

@Oblomov
Copy link
Contributor

Oblomov commented Dec 12, 2020

Wouldn't this be better done in OPENCL_VENDOR_PATH instead?

@isuruf
Copy link
Author

isuruf commented Dec 13, 2020

Yes, but that only supports one directory at a time.

@Oblomov
Copy link
Contributor

Oblomov commented Dec 13, 2020

Well, I meant extending OPENCL_VENDOR_PATH to become a colon (semicolon in Windows) separated list of paths.

@Kerilk
Copy link
Contributor

Kerilk commented Dec 14, 2020

I am working with the OpenCL WG to reunify the way the loaders are configured. These things take time, but I'd rather not add additional divergence at this point. This prevents me from using OPENCL_VENDOR_PATH which is not supported by the official loader.

One thing I would be open to is adding support for OCL_ICD_FILENAMES that is supported in the Khronos loader. I will also make a proposal to the WG regarding @isuruf suggestion.

@baryluk
Copy link

baryluk commented Dec 26, 2020

Hi. I also stumbled upon this (not for the first time). I want to have 64-bit and 32-bit icd files passed, and right now, it just blindly tries to open the file:

stat("/home/user/mesa-git/installdir/build-amd64-opt/install/etc/OpenCL/vendors/mesa.icd:/home/user/mesa-git/installdir/build-i386-opt/install/etc/OpenCL/vendors/mesa.icd", 0x7fff8e9e0150) = -1 ENOENT (No such file or directory)

At this point tho, I think it would be better to follow Khronos way and support OCL_ICD_FILENAMES exactly like they do. It would really help. Something that works in unified way in both ocl-icd and Khronos loader, and future other loaders, would be awesome.

@Ashark
Copy link

Ashark commented Apr 26, 2023

This OCL_ICD_FILENAMES is not supported yet? I am not able to set a specific icd file when there are several in system. According to manual, I can set a single icd file in OCL_ICD_VENDORS. Now when I try it like this: OCL_ICD_VENDORS=/etc/OpenCL/vendors/mesa.icd clinfo -l or like this: OCL_ICD_VENDORS=mesa.icd clinfo -l, then there are no any platforms detected! Is there a way to at least specify a single icd file?

The workaround I found for now is to copy the needed icd file (or a set of files) to a different directory, and specify it in OCL_ICD_VENDORS. So for example there are two amd platforms: orca and rocm. I want to be able to select any set and test how application will work with them. I create three directories in /home/andrey/ocl/ and the following tree inside:

├── orca
│   └── orca.icd
├── both
│   ├── orca.icd
│   └── roc.icd
└── roc
    └── roc.icd

and choose one of them by specifying OCL_ICD_VENDORS=/home/andrey/ocl/orca/, OCL_ICD_VENDORS=/home/andrey/ocl/both/ or OCL_ICD_VENDORS=/home/andrey/ocl/roc/. And this is not very convenient. By the way, trailing slashes are required for some reason.

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

No branches or pull requests

5 participants