You are not logged in.

#1 2018-10-10 03:46:50

jamespharvey20
Member
Registered: 2015-06-09
Posts: 129

[SOLVED] Way to tell OpenCL and Vulkan ICD which runtime to use?

Is there a good way to have multiple OpenCL and Vulkan runtimes installed, and designate per application which to use?  (That is, if the application itself doesn't support more than choosing OpenCL vs Vulkan.)

If not, is there at least a good way to tell "ocl-icd" and "vulkan-icd-loader" what its default choice should be?  That could be globally set before starting a particular app.  It seems like this is functionality both of these should have, but I'm not seeing any type of "conf" file for them.

At least "clinfo" only sees entries in "/etc/OpenCL/vendors/" if they end in ".icd", so maybe it would work to rename all but one entry ".icd.disabled".

Likewise, at least "vulkaninfo" only sees entries in "/usr/share/vulkan/icd.d" if they end in ".json".

I really hate the idea of renaming package-owned files though.  And, I don't know if the entire OpenCL/Vulkan systems will skip renamed entries like their "info" programs.

Also, "chmod 000" on all but 1 works for the "info" programs as well.  Perhaps that's a little bit better than renaming a package-owned file.  I checked, and it looks like pacman doesn't error when upgrading (well, I was technically testing reinstalling) the package.  It of course does set the permissions back to their default.

---Additional Info---

I'm using the open-source amdgpu kernel driver, and the xf86-video-amdgpu Xorg driver.

For the OpenCL loader, I have "ocl-icd" installed.  For OpenCL runtimes, I have installed: "opencl-mesa" (open-source mesa); "opencl-amd" (AUR, extracts only the OpenCL support from the proprietary "amdgpu-pro" driver which can run on top of the open-source amdgpu driver); and "intel-opencl-runtime" (AUR, Intel Core and Xeon.)

For the Vulkan loader, I have "vulkan-icd-loader" installed.  For Vulkan runtimes, I have installed "vulkan-radeon" (open-source mesa, called RADV); and "amdvlk-git" (open-source AMD.)

I'm finding each application has its own runtime that it works best with.  I'm having lots of oddities like other monitors turning off even when something is in windowed mode, hangs, and even when everything works perfectly, one of the runtimes may provide significantly better performance for this application.

Last edited by jamespharvey20 (2018-10-12 01:21:28)

Offline

#2 2018-10-10 07:37:14

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,418

Re: [SOLVED] Way to tell OpenCL and Vulkan ICD which runtime to use?

No idea about opencl but with vulkan you can set VK_ICD_FILENAMES to the specific icd you want to load like e.g. on nvidia /usr/share/vulkan/icd.d/nvidia_icd.json That way the default loader mechanism will be disabled and only filepaths contained in that environment variable will be considered.

Online

#3 2018-10-12 01:21:12

jamespharvey20
Member
Registered: 2015-06-09
Posts: 129

Re: [SOLVED] Way to tell OpenCL and Vulkan ICD which runtime to use?

Thanks!  That works perfectly for me for Vulkan.

For OpenCL, turns out there is a similar environment variable.  OCL_ICD_VENDORS can be set to a full filename (must end with .icd) of a file in "/etc/OpenCL/vendors", and only that file will be used.  So, for example, "OCL_ICD_VENDORS=amdoc-orca64.icd ./indigo_benchmark" (There's some other ways to use this variable and some others, in upstream's manpage, which isn't in Arch's package yet, but I've filed a bugreport.)

Offline

Board footer

Powered by FluxBB