-
Notifications
You must be signed in to change notification settings - Fork 822
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
No OpenCL platforms reported #6951
Comments
One day <3 |
Any update here? |
Check for any update |
Yes, OpenCL is a crucial feature. We're putting together a native Linux box for testing next week due to this. |
This would be wonderful for my team. We have considered rewriting everything in cuda, but that has major downsides. Until OpenCL support is released, we are stuck dual-booting. |
YEP |
hope for any update |
1 similar comment
hope for any update |
In theory OpenCL/WSL2 may now work for Intel Integrated Graphics GPUs: https://devblogs.microsoft.com/commandline/oneapi-l0-openvino-and-opencl-coming-to-the-windows-subsystem-for-linux-for-intel-gpus/ Trying a few days ago, I didn't see any CPU platforms get registered (I am on AMD for CPU) nor any GPU (I am on Nvidia for GPU) |
any info about whether NVIDIA GPU computing is planned to be supported for OpenCL? |
Any new info a year later? |
Better late than never, right? |
Still waiting |
same issue when trying to run a boost example program
|
I should have checked this before wasting a whole day trying to get it to work ... still waiting |
same |
I found the solution, as it is going to be usual from now on, by asking ChatGPT. To set up OpenCL on WSL, you can follow these general steps:
After completing these steps, you should be able to use OpenCL on WSL. Note that the specific steps and packages required may vary depending on the Linux distribution, GPU hardware, and OpenCL implementation you are using. |
@jorgevazquezperez is that proven working or a hallucination? |
Proven working. It is needed to note that I have only achieved it with the CPU, but I am in process to be able to do it with the GPU. I attach you a picture with the results and I will keep you updated with the GPU version (as I imagine that it is the one you all are looking forward to). If you need more info just tell me! PD: I am using python with the pyopencl library. |
Yes, afaict CPU and integrated Intel GPU should work, but unclear if/how Nvidia |
It's about getting Nvidia OpenCL to work in WSL2, not CUDA Runtime or AMD HIP/ROCM, is that correct? Please accept my apology if I misunderstood earlier. I remember having CUDA and AMD running as OpenCL in WSL2 in the past. However, due to driver changes, I had to reinstall Nvidia, which resulted in it breaking. Below is my clinfo with the AMD platform running. Unfortunately, both my RX470 and RX580 died, and I don't have another AMD card to try and show the result.
|
Yes, that is still not showing Nvidia <> opencl <> wsl2 |
Since NVIDIA OpenCL ICD is built on top of CUDA, it's a bit hard to understand why OpenCL/NVidia is not supported under WSL2 when CUDA is functional. Clearly it's not a technical issue but a commercial issue. Please correct me if i'm wrong. |
I manage to get Intel OpenCL working in WSL2, I think.
|
This issue is about Nvidia cards not being shown, not intel/amd |
The title of the issue is simply "No OpenCL platforms reported" - not "No NVidia OpenCL platforms reported" |
The issue is about Nvidia cards not being shown. |
edmondium@LAPTOP-1Q9H40K6:~$ clinfo |
Looks like an Intel cpu/GPU again ^^^^, so same status |
Has anyone gotten OpenCL working with Edit: If you use a recent enough version of Ubuntu (i used 24.04, which is bleeding edge), you can just (base) root@cfbb31c89f97:/# clinfo
Number of platforms 1
Platform Name Portable Computing Language
Platform Vendor The pocl project
Platform Version OpenCL 3.0 PoCL 4.0+debian Linux, None+Asserts, RELOC, SPIR, LLVM 15.0.7, SLEEF, DISTRO, POCL_DEBUG
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd cl_pocl_content_size
Platform Extensions with Version cl_khr_icd 0x400000 (1.0.0)
cl_pocl_content_size 0x400000 (1.0.0)
Platform Numeric Version 0xc00000 (3.0.0)
Platform Extensions function suffix POCL
Platform Host timer resolution 0ns
Platform Name Portable Computing Language
Number of devices 1
Device Name cpu-haswell-AMD Ryzen 5 5600X 6-Core Processor Note that this is still not a solution for |
@alex-ong I have it working in WSL2 Ubuntu 22.04 without pocl on a laptop with a 5800HS, but for the intel platforms to be detected I have to source the setvars.sh script from the Oneapi installation. I installed it a long time ago so I don't recall the details of how I installed it. But I don't remember having much trouble with it. |
I was able to run OpenCL on NVIDIA on WSL2 via PoCL I took the following steps:
1.1. Now you can run
Then run On successful build you can try if it works without installing Also My
And some benchmark (i dont know what these numbers means, good or bad)
|
@Bossach Now this looks promising! PoCL too seems to have come a long way since I last checked. I might give it a try at some point. |
This worked for me. I installed it but the arguments aren't passed by default if I do clinfo it works with the |
@joaomamede Alternatively, yo can put |
Thanks for your share! I follow your step and it almost successful. However, the clinfo told me that "unknown target CPU 'sm_89'". Here is my full output and full benchmark. clinfo:
benchmark:
|
@Tongzhao9417
You need newer version of LLVM/clang. (Just checked llvm-16 from debian repo have "sm_89" one) |
Sorry for late reply. I follow your step and it's worked for me. Cheers! |
I compiled POCL as decribed above and now
Does POCL not support OpenCL 2.0 ? |
Absolute king. pocl-opencl-icd was the missing link for me. Ty, sir. |
I really appreciate for your brilliant solution! I want to ask one question to you and everyone who reacted to Bossach's comment and/or tried the solution (@husmen @joaomamede @Tongzhao9417 @olympichek @htao7 @kirse @kon332k): have you tried the PoCL verification tests for NIVIDIA GPU I basically followed Bossach's steps to install PoCL and now have cd ~/pocl-6.0/build # move to my `build` directory
../tools/scripts/run_cuda_tests
# For rerunning the failed tests:
../tools/scripts/run_cuda_tests --rerun-failed --output-on-failure Failed tests were: The following tests FAILED:
4 - kernel/test_as_type_loopvec (Failed)
166 - regression/clSetKernelArg_overwriting_the_previous_kernel's_args_loopvec (Failed)
208 - runtime/test_device_address (SEGFAULT)
209 - runtime/test_svm (SEGFAULT)
Errors while running CTest If anybody has conducted the verification test, could you please tell us whether you pass all tests or which tests you miss? It would be also very helpful if you could tell us about the runtime environment and settings, and configurations for PoCL installation. I opend an issue on PoCL's repo |
Hi, Result of clinfo: Result of nvidia-smi +-----------------------------------------------------------------------------------------+ |
Windows Build Number
21382.1
WSL Version
Kernel Version
5.10.16.3
Distro Version
Ubuntu 20.04
Other Software
Inside WSL:
clinfo (for checking OpenCL platforms)
CUDA 11.3 (docker container runs with NVIDIA_DISABLE_REQUIRE=1, as it otherwise thinks it's running 11.0)
Docker 20.10.6, build 370c289 (with custom container)
nvidia-docker2 2.5.0-1
On Windows:
NVIDIA Graphics Driver for CUDA on WSL 470.14
Repro Steps
I installed the Nvidia drivers and docker as according to Nvidia's user guide
I am however running an older version of nvidia-docker2 (and dependencies) as according to a forum post here
Additionally, I have also installed the CUDA on WSL driver here
Steps:
Run clinfo (both in and outside of the Docker container)
Expected Behavior
clinfo should return the graphics card (in my case, GTX 970) as an OpenCL platform
Actual Behavior
clinfo reports 0 platforms available, both inside the container and just on WSL
Diagnostic Logs
cuda
nvidia-container-cli
glxinfo (from inside of container)
glxinfo (from WSL, outside of container)
wsl.etl
The text was updated successfully, but these errors were encountered: