SciNim / nimcuda

Nim bindings for CUDA
Apache License 2.0
42 stars 9 forks source link

Cuda >= 11.7 support #14

Open dlesnoff opened 2 years ago

dlesnoff commented 2 years ago

What would this take to add support for cuda 11.7 ?

Vindaar commented 2 years ago

It depends, in principle not much.

The question is what of the API has changed and if it's easier to simply regenerate the full wrapper or to manually add the changes.

dlesnoff commented 1 week ago

@lilkeet Thanks so much! Going to try it out this week-end hopefully

dlesnoff commented 1 week ago

I have been able to compile and run successfully two examples out of three.

Warnings in random. (We might want to desactivate the warnings in the .nimble file rather than removing these else's that serve as extra checks well).

~/Documents/dev/nimcuda/src/nimcuda/cuda12_5/cuda_occupancy.nim(799, 5) Warning: unreachable else, all cases are already covered [UnreachableElse]
~/Documents/dev/nimcuda/src/nimcuda/cuda12_5/cuda_occupancy.nim(842, 5) Warning: unreachable else, all cases are already covered [UnreachableElse]
~/.cache/nim/fft_d/@m..@s..@ssrc@snimcuda@scuda12_5@scufft.nim.c:94:10: fatal error: vector_types.h: No such file or directory
   94 | #include "vector_types.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
~/.cache/nim/fft_d/@mfft.nim.c:94:10: fatal error: vector_types.h: No such file or directory
   94 | #include "vector_types.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

Note: I installed Cuda 12.6.2 on my system.

lilkeet commented 1 week ago

Warnings in random. (We might want to desactivate the warnings in the .nimble file rather than removing these else's that serve as extra checks well).

agreed. either there or via a push + pop pragma.

~/.cache/nim/fft_d/@m..@s..@ssrc@snimcuda@scuda12_5@scufft.nim.c:94:10: fatal error: vector_types.h: No such file or directory
   94 | #include "vector_types.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
~/.cache/nim/fft_d/@mfft.nim.c:94:10: fatal error: vector_types.h: No such file or directory
   94 | #include "vector_types.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

Note: I installed Cuda 12.6.2 on my system.

right now, the nimble file's exampleConfig proc assumes that you have the exact version installed that the library is targeting. in this case, 12.5. since ur installed version is 12.6, the directory for 12.5's include directory doesn't exist and it cant find the vector_types header. this isn't an issue for when you actually use the library in your code, as you would have to pass ur install location explicitly via -cincludes:"path/to/cudaVer/include" and -clibdir:"path/to/cudaVer/lib64".

dlesnoff commented 8 hours ago

The bizarre thing is that random and blas examples work well in my case while fft example doesn't, thus it must not be a problem of versioning. The fft example needs to be updated for 12.5 by removing the import related to vector_types.

EDIT: the issue is probably stemming from the non-generated cufft wrapper #24

lilkeet commented 6 hours ago

works on my machine ¯\(ツ)/¯