Skip to content
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

Not available on win10 #22

Open
863689877 opened this issue Sep 23, 2022 · 13 comments
Open

Not available on win10 #22

863689877 opened this issue Sep 23, 2022 · 13 comments

Comments

@863689877
Copy link

Hello, I can successfully compile and install lietorch on Windows, but I cannot pass the gpu related tests. When running the simplest multiplication, likes X1 = Ts * X0, it will get stuck and exit.

@madnananwer
Copy link

madnananwer commented Oct 9, 2022

I'm having the same issue. Did you find the solution?

@yclicc
Copy link

yclicc commented Nov 22, 2023

I'm still not sure why it should be, but I managed to fix this on Windows by making all the CUDA kernels in lietorch_gpu.cu accept regular pointers where currently they accept const pointers. Hopefully someone who knows more about CUDA and Windows can make a proper pull request.

@carlosedubarreto
Copy link

Hello @yclicc , I have almost knowlegde of this type of programming. Can you tell how to change the const pointer to regular ones, like you said?

Or could you share your lietorch_gpu.cu?

thanks

@yclicc
Copy link

yclicc commented Feb 1, 2024

@carlosedubarreto well you just get rid of the word "const" in the function arguments. So for example

__global__ void exp_forward_kernel(const scalar_t* a_ptr, scalar_t* X_ptr, int num_threads) {

becomes __global__ void exp_forward_kernel(scalar_t* a_ptr, scalar_t* X_ptr, int num_threads) {

In practice if you want to maintain the old behaviour (which presumably has some benefit) on non-windows platforms you can add before the first template the following:

#ifdef _WIN32
    #define NON_WINDOWS_CONST
#else
    #define NON_WINDOWS_CONST const
#endif

and then replace all the consts in function parameter lists with NON_WINDOWS_CONST. Then on Windows it will remove the const at compile time but keep it in on other platforms. So for our example above you would end up with __global__ void exp_forward_kernel(NON_WINDOWS_CONST scalar_t* a_ptr, scalar_t* X_ptr, int num_threads) {

I hope that helps!

@carlosedubarreto
Copy link

@yclicc thanks a lot for the detailed info.

I gave a shot just by replacing the "const" from nothing na it didnt work, maybe I did something wrong, I'll try again.

thanks a lot!!!!

@yclicc
Copy link

yclicc commented Feb 1, 2024 via email

@carlosedubarreto
Copy link

@yclicc after reading the old comment you did, I replaced the text "const " to "" and compiled it again.
I had no success. but it was a quick test.

Now I'm gong to do it all from the start with more attention.

@carlosedubarreto
Copy link

I tested again doing a clean install, and it seems to be working, thanks A LOT @yclicc !!!!! I'm sharing here the final file I changed.
lietorch_gpu.zip

@yclicc
Copy link

yclicc commented Feb 1, 2024

Awesome, glad it worked for you as well as for me! Now we just need to ask someone with more knowledge of windows and cuda why it works!

@carlosedubarreto
Copy link

Im actually more curious to know how could you guess that removing the "const" would make it work 😊

@yclicc
Copy link

yclicc commented Feb 2, 2024

Lots of trial and error, and the Nsight debugger

@carlosedubarreto
Copy link

Oh Nsight debugger. Now I know that serves for something 😀, thanks a lot for the info 🦾

@gha890826
Copy link

I tested again doing a clean install, and it seems to be working, thanks A LOT @yclicc !!!!! I'm sharing here the final file I changed. lietorch_gpu.zip

Thanks for your sharing!
I solve same problem by this solution.

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