-
Notifications
You must be signed in to change notification settings - Fork 24
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
Any way to run on Windows? #70
Comments
I did not try cl-cuda on Windows, but I suppose that if you could satisfy the following points, cl-cuda would run on Windows even natively without MSYS/MinGW help. How about these?
|
Can't find |
I can find |
Cupy https://github.com/pfnet/chainer/tree/master/cupy does the almost same thing with cl-cuda in Python, generating CUDA C codes, compiling them with NVCC and launching kernels, and it works on Windows as well, so it should be possible. |
My installation was slightly borked due to the lack of a valid Visual Studio version. That problem is fixed and my environment is actually working now, but I still can't find the right DLL(s). Haven't taken a look at exactly what cupy does yet. Here are the DLLs I can find.
|
This https://developer.nvidia.com/cuda-faq says that needed to use the driver API is "nvcuda.dll" and it is included as part of the standard NVIDIA driver install. Would you find it in Windows system folders such as System32? Cl-cuda uses the driver API only. |
Appears to work on SBCL for me.
|
Okay, then you should be able to load cl-cuda with nvcuda.dll.
Please set
You may need to pass some options to nvcc via |
Can't even load the system in the first place thanks to an error groveling a file in
|
Ah... grovel... I missed you mentioned first with nvcc. While I will think of some working around, how did you failed on MSYS2/MinGW64 at frist?
|
AFAICT (definitely not an expert systems programmer :-), NVIDIA distributes their dev environment as binaries, but provide |
Is it possible to call nvcuda.dll from SBCL on MinGW?
|
I suppose that MinGW has a feature to call DLLs as well as GNU libraries, though not familiar with its calling convension. |
MinGW does use DLLs as its shared library format, but as I understand it they are linked to an old
|
What does gcc return if directly executed? You would be able to find some error messages.
|
Command as written fails because |
(Note the |
You do not have the path
|
Aha, that was it. |
Please add the path to |
That seems to work! Thanks! |
I see you have a list of supported environments in the README. If you let me know how to run the test suite, I can verify it passes and submit a PR with my specifics. |
Test programs or |
It helps me a lot. You can run the test with |
|
|
Would you try it again with the following fix in cl-cuda/src/driver-api/library.lisp ? (cffi:define-foreign-library libcuda
+ (:windows "nvcuda.dll")
+ ; (:windows "nvcuda.dll" :convention :stdcall)
(:darwin (:framework "CUDA"))
(:unix (:or "libcuda.so" "libcuda64.so"))) At least, |
Both versions seem to work, and further into the test suite we get |
This test also fails further up the chain.
|
OSICAT-POSIX:MKTEMP might not work on Windows, please apply this patch as working around. I use MKTEMP just for making temporary file name. I will fix it later. cl-cuda/src/api/nvcc.lisp
|
This is that the test is wrong, I will fix it. You can ignore this.
|
All right, now the command It seems like NVCC is designed to run from inside Visual Studio on Windows. I'll see what I can do to fix the path. |
Indeed, running SBCL from Visual Studio's CMD makes many of the tests run. Then,
|
Can I see the part of failed /tmp/cl-cuda.tmp.cu ? It might be caused by difference in gcc and cl.exe. |
It seems that cl.exe does not accept struct initializers as expressions. I will give you a patch, I want to make cl.exe cause no errors in these tests. |
Wait a while because I'm at work now. |
In that case, I'll take a moment to thank you for the manner in which you're handling the ticket. Really appreciate the promptness of responses and willingness to direct my exploration of the problem :-)! |
You also help me a lot to let me know how cl-cuda goes on Windows. Thanks. |
Would you try this patch? This disables compiling to compound literals. cl-cuda/src/lang/built-in.lisp
cl-cuda/t/api/defkernel.lisp
|
Test suite loads now, but with tons of errors. The colors don't render properly in |
No red tests. There is a ton of grey, however, and several places red times show up. I'm assuming grey is passed tests and red times in ms mean the test ran long, but not familiar enough with the test framework to say. |
Thanks. Sounds good. Would you try this sample code? This computes elementwise addition across two arrays.
If you get the following message, cl-cuda does work on Windows.
|
That does indeed show up! |
Great! I hope you will enjoy CUDA in Common Lisp. And can I have your environment?
|
I will note it on README. |
|
Is this result on MSYS2/MinGW64?
|
No, that's the trick of this method. You have to load the system in MSYS2/MinGW64 first so that GCC can and do Lisp's groveling work. On the other hand, subsequent loads need to be done from the VS2013 CMD so NVCC has access to MSBuild. In theory you could use the MSYS2 shell and source |
I got it, thanks. |
Quick update: You can get the MinGW shell running with VS 2013 PATH augmentations, but not the way I thought. The shell can't source batch files AFAICT, so you need to launch MinGW64 from CMD. First, make sure the following line is uncommented in
Then launch the Developer Command Prompt for Visual Studio 2013. From there, run You will have a decent terminal emulator with Unix utilities and NVCC on the path properly. This allows using |
What is the current status on this? It looks like MS Windows works, but I cannot find reference to it in the README. Looking at the issues, it seems that some of the patches mentioned have not been applied to master (?). Just taking stock of the situation before I get started. I need cl-cuda on Windows as well. |
Setting up
cl-cuda
seems to hook intogcc
to create the FFI. GCC is well and good thanks to MSYS2/MinGW64, but apparently the CUDA toolkit and MinGW don't play nice together. Is there any way to set upcl-cuda
to use the Windows CUDA toolchain?The text was updated successfully, but these errors were encountered: