Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

CUDA Integration In UE4 NEXT STEP??

So i was successful in integrating the cuda static lib file in ue4 with the help of an article by http://www.sciement.com . I also asked a question there but no reply . So i just want to know , once i had made the static lib file and i am able to use cuda functions in my actor class in ue4 but where do i have to define the threads from this cuda function "global" . Do i have to define number of threads or write my logic ,then i have to make a static lib out of it and again integrate in ue4? or is there a easy way?

Product Version: UE 4.17
more ▼

asked Feb 15 '18 at 05:24 AM in C++ Programming

avatar image

1 1 3 3

avatar image HollingsworthDan Feb 15 '18 at 06:22 AM

I'm afraid that link is of no value. Do you have a more direct download link? Where did you get this "cuda static lib file in ue4 ".

The thing about cuda is it takes a decent engineer to write cuda code. and get an actual advantage out of it.

If you give me more information I will attempt to integrate some basic cuda functionality for UE4 with you.

avatar image Saurabh0190 Feb 15 '18 at 07:06 AM

yeah sure http://www.sciement.com/tech-blog/c/cuda_in_ue4/ . I had tried cuda without ue4 but i was thinking about putting it in ue4. There is also a cool marching cube project these guys have done with the help of cuda in ue4

avatar image HollingsworthDan Feb 16 '18 at 02:07 AM

tx. I'll pull it down and check it out. Do you have a link that is not in some multibyte asian codepage?

avatar image HollingsworthDan Feb 16 '18 at 03:05 AM

The global function gets launched from the CPU thread and at that time the GPU threads are set up. In this example with the size variable in the CPU code, which is passed in.

addKernel2 <<<1, size>>> (dev_c, dev_a, dev_b);

where size comes from function parameters:

cudaError_t addWithCuda(int *c, const int *a, const int b, unsigned int size, std::string error_message)

And the calling code passes in arraySize:

cudaError_t cuda_status = addWithCuda(c, a, b, arraySize, &error_message);

AS far as this example goes, yes. You have to edit the lib source code, RE-compile, RE-integrate, and rebuild unreal.

A better solution would be to go into the engine, and learn it how to generate and compile CUDA only modules. Then you could use the UnrealBuidTool to generate the new target type, kick off the cuda compiler, and turn the lib into a dll, (module), that can be used by other C++ modules.

And this is something I will be exploring this weekend if time permits.

avatar image Saurabh0190 Feb 17 '18 at 05:15 PM

I also have to do some time test . I need to see if CUDA is really making any changes , also i have learnt that for some code which is not that heavy its not making any difference . The big ones need to be optimized. Thanks for the reply though and if you found something do let me know . :)

avatar image HollingsworthDan Feb 17 '18 at 07:42 PM

I have the loose VCXPRoj building and working. And yes the sample code, would be a waste of time to push to the GPU for more than just being an example. I also found a bug, maybe VS. But if you dont hit rebuild if you just hit build then it does not re-compile the Device Code. I'm currently setting up UE 4.19 preview to start integrating changes.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question