Comments (10)
Hi,
the reason that you are not seeing kernels run on the GPU is because we output kernels to be executed on the GPU in the SPIR 1.2 or SPIR-V formats (that said, the SPIR-V backend is very experimental, and for OpenCL only). Currently, nvidia's OpenCL implementation does not support either SPIR 1.2 or SPIR-V, and therefore we can't run on nvidia.
On a more technical level, what is happening is the default selectors circulated with ComputeCpp query the devices on the system for SPIR support (i.e. look for the extension "cl_khr_spir"). If no devices on the system report that they support it, as is the case here, ComputeCpp falls back to the host device. When you explicitly request a GPU, it fails to find such a device, so an exception is thrown. We decided we wanted the SDK to run under most circumstances we could think of (and it helps with travis testing, too).
I can recommend trying out the pocl implementation. Recently, they added support for nvidia devices, though it is somewhat incomplete. We don't officially support it, but I have managed to run some of the samples on my home PC that has a 780 in it. There is one issue: pocl reports that it doesn't support the spir extension either, but they definitely do! This requires modification, but you can force selection of any device you like (for example, by requesting all devices on the system, then filtering on name or similar). There is also a custom device selection interface as described in the "custom device selector" sample.
As a last note, we recently updated ComputeCpp again, you should now be able to download 0.3.1 from the website. I don't believe there are any changes required to the SDK for this release, even though there is no 0.3.1 tag yet.
If you've any other questions or problems, update this issue and I'll do my best to help.
from computecpp-sdk.
I did little more digging this week, as it turns out it's relatively simple to turn on SPIR support in pocl - though I should check that what I'm doing is valid, as I am experiencing some failures and would like to check that it's not me first! If I verify that using pocl with a system clang is basically equivalent to using the SPIR generator from Khronos, then I will post my (very simple) patch here and let pocl know. If it turns out that the clang SPIR generator is very necessary for proper operation, then back to the drawing board I suppose!
from computecpp-sdk.
Hi @babouFomb,
Did you manage to make any progress on this?
from computecpp-sdk.
@DuncanMcBain haha the PoCL path seems just insane. :-)
I would love having feedback on this at the next Khronos meeting during SYCL and/or SPIR sesions.
from computecpp-sdk.
It's honestly not so bad! I've not yet made an issue, but my opinion is that pocl should unconditionally report SPIR support, since they are always capable of consuming it. If that were the case then pocl/nvidia would "just work" with the SDK.
The problem is that ComputeCpp discards devices it cannot use in the default selector, so unless you make some changes the samples won't find any devices. I don't think we should change the SDK for this case though.
What sort of feedback were you looking for in the next meeting?
from computecpp-sdk.
it think it would be interesting to have a few slides describing this interesting ComputeCpp+PoCL use case, even if it requires selecting explictly the device.
from computecpp-sdk.
I was thinking to the ComputeCPP→PoCL→CUDA/PTX use case.
There is otherwise some support for SPIR in PoCL, even I had to do some change to support SPIR 2.0 encoded in Clang 3.9 for example (SPIR "de-facto"...).
from computecpp-sdk.
I proposed my SPIR "de-facto" ingestion in pocl/pocl#529
I do not know if it solves your issue or not.
from computecpp-sdk.
That might make things easier for sure, though I was ill yesterday and haven't yet tested the clang spir issue. Hopefully I will get to that today. Thanks!
from computecpp-sdk.
Closing due to lack of action.
from computecpp-sdk.
Related Issues (20)
- terminate called after throwing an instance of 'cl::sycl::invalid_object_error' HOT 6
- CE1.3.0 ptxas fatal : Ptx assembly aborted due to errors (VS2015 + Win10) HOT 8
- Using compute++ with compiler different from /usr/bin/c++ HOT 7
- Terminated after throwing instance of cl::sycl::invalid_object_error HOT 13
- Can't compile samples: missing standard c++ headers HOT 12
- error: no matching function for call to 'clCreateProgramWithSource' HOT 5
- Enabling __CUDACC__ is a bold move HOT 3
- is_accessor trait requires exactly 5 template arguments HOT 4
- Error when running SYCL program with ComputeCpp on CMake : 'cl::sycl::invalid_object_error' HOT 5
- simple-vector-add.cpp throws cl::sycl::compile_program_error exception HOT 4
- Running SYCL program in MSVC Debug mode throws std::bad_array_new_length HOT 9
- cmath not found: Missing Header HOT 5
- atomic add for double HOT 1
- can't download computecpp HOT 1
- samples about atomic op
- about __SYCL_DEVICE_ONLY__ macro HOT 1
- Has ComputeCpp_DIR worked, ever? HOT 4
- Missing ComputeCpp.props error HOT 4
- Exception when running VS example code HOT 5
- MSVC new project not running HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from computecpp-sdk.