-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add nvrtc_cli tool #105
Add nvrtc_cli tool #105
Conversation
- This allows NVRTC to be driven via a nvrtc_cli executable that operates identically to nvcc (for the subset of functionality supported by NVRTC). - This is useful for testing, and we also plan to integrate it into the godbolt.org Compiler Explorer. - Includes a script for testing basic functionality of the tool.
} | ||
|
||
#if CUDART_VERSION >= 11010 | ||
size_t cubin_size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering if you can make a run-time check for the nvrtc library version as well here and for the get NVVM below, to make this more robust? Else this will break if compiled with a toolkit that's newer than the the libnvrtc.so
. May be a situation we don't care about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's using regular dynamic linking, so it will crash with symbol lookup error: ./nvrtc_cli: undefined symbol: nvrtcGetNVVMSize
at startup, regardless of whether there is a runtime check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I realize that (as that is what happened to me when I initially tested this 😄 ). This is what got me thinking if it was worth doing something smarter with dlopen
etc. was worth it.
} | ||
|
||
nvrtcResult get_supported_archs(std::vector<int>* supported_archs) { | ||
#if CUDART_VERSION >= 11020 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here about checking version at run-time. For pre 11.0 that is a trivial change, since one doesn't have to mess with the presence (or not) or a shared library function.
} else if (sarg == "-ptx" || sarg == "--ptx") { | ||
output_ptx = true; | ||
} else if (sarg == "-cubin" || sarg == "--cubin") { | ||
#if CUDART_VERSION >= 11010 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this should be run-time here as well. Should be trivial in this case.
Just wondering about getting this old PR. @benbarsdell can you make the trivial changes I noted above and we can get this merged? (we can just ignore my run-time checking for now) |
e28616d
to
4ab81e0
Compare
Sorry it took so long to get to this. I've added nvrtc_cli to |
I'd prefer less |
Maybe I misunderstood, I'm having trouble thinking this through. Some of them need to be compile time checks, and those won't gain anything by adding runtime checks. Will other parts benefit from having runtime checks? |
This allows NVRTC to be driven via a nvrtc_cli executable that operates identically to nvcc (for the subset of functionality supported by NVRTC).
This is useful for testing, and we also plan to integrate it into the godbolt.org Compiler Explorer.
Includes a script for testing basic functionality of the tool.