-
Notifications
You must be signed in to change notification settings - Fork 3
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
Overlap with my rust-gpu-cli
project?
#12
Comments
Oh and some more ideas...
|
|
Awesome, I hadn't seen your project (but now I see I have it starred so I must have at some point). We should definitely join forces 🚀 FWIW my plan for |
(as an aside I've been trying to get a hold of @Shfty for a while with no luck) |
I think this will always be the case. Likely because wrangling the I tend to prefer the latter case you mentioned, where a standalone cli program compiles the shaders. This is mostly because I don't want to pin my project to an older nightly and also because the compile times can be a bit long. |
We have been talking a bit about that. I'm for it, but it's a lot more effort than I have at the moment. It's a good idea - I see that building I do feel that it's a nice-to-have but compiling locally is the 20/80 IMO. (The 20% effort that gets you 80% value). |
Unfortunately the nightly toolchain is needed for compiling both. It all has to align. sigh The good news is that with |
Yes, it installs toolchains and components. I agree with you that this should probably be more explicit since these are pretty big downloads. Maybe we should take some confirmation from the user by default? |
Yeah, that's probably a good thing to have. Good call. |
I know |
Haha! 🙇 Well I did have this in Also, it seemed more correct to have |
Lastly but not leastly - I'm looking forward to your contributions, @tombh ! Thank you! |
|
I'm in favor of that! If you're on the happy path then it's definitely the shortest path to compiling Rust shaders.
Yes, exactly.
I'm in favor of this, but that module is behind a feature, so we're not paying for it in any way besides maintenance - and probably not even that, I wouldn't be surprised if that module has bit rotted. Lastly about the relationship between I guess I'm just wary of putting To that end I think it would be great to expose |
This reminds me, I've been thinking we need a sort of "life before (GPU) main" type API to really make rust-gpu usage ergonomic without tying to a specific host framework. For example, if I want to make a shader have different behavior for different dispatch sizes or do different things on different hardware, there is no standardized way. Heck, even just logging has to be bespoke. I agree that we don't want to tie to a particular host library or framework, but not having something that is "host aware" means we can't build reusable higher-level abstractions because many of them require the host side to cooperate. |
It definitely works, I'm using it in my
I totally agree with everything you mention. And what do you think about advertising That mysterious |
These are all great points. The only downside I see to advertising So I guess the question is - how many folks are targeting Vulkan through |
Ahhh yes Vulkan, I forgot that.
That is indeed a critical question. I'm afraid I couldn't even guess at an answer. Though I'd venture to answer a similar question but asked from the opposite angle: how many developers of And I must say there's absolutely nothing wrong with that. The only thing I'd like to see is that the documentation is more aligned with And of course I'm sure we'll reach parity with OpenGL and Metal soon!. |
Yes, agreed :) |
For the last couple of Rust GPU projects I've been building my shaders using a standalone compiler, https://github.com/tombh/rust-gpu-cli, which is based on Bevy's https://github.com/Bevy-Rust-GPU/rust-gpu-builder.
My own reason for this is that I found it hard maintaining both my own application code and the shader code in the same repo. I think mostly because of
rust-gpu
's requirement for a specificrust-toolchain.toml
.I suspect
cargo gpu
will also solve this problem? In which case I'd like to contribute and focus my efforts here instead 🤓So some reflections as both a
rust-gpu
andrust-gpu
CLI frontend user:rust-gpu
always support both ways of compiling shaders? Therefore auto-magically in a monorepo and with a standalone CLI frontend? Personally I'm currently leaning towards only supporting the latter. There are so many unconventional moving parts in compiling Rust shaders that I think hiding too much of the magic can lead to more harm than good.cargo gpu
will be published to crates.io. I wonder if it can be taken one step further and pre-compiled to static, cross-platform binaries? Possibly that's what you were discussing in Investigaterustup component
forcargo-gpu
#2? I've actually already had success with this on Github Actions: see https://github.com/tombh/rust-gpu-cli/pull/1/files It compileslibrustc_codegen_spirv.{so,dylib,dll}
. And then the actual finalrust-gpu-cli
app dynamically sets theLD_LIBRARY_PATH
(orDYLD_FALLBACK_LIBRARY_PATH
etc depending on the OS). The only problem I faced was thatrustup
can't cross-compilerustc-dev
so I haven't been able to getaarch64
binaries for Linux compiling yet.rust-toolchain.toml
needed for compilinglibrustc_codegen_spirv.so
or for compiling shaders or for both? Because if it's just for compilinglibrustc_codegen_spirv.so
then does that mean that pre-compiled versions oflibrustc_codegen_spirv.so
would avoid the need forcargo gpu
to install its ownrustup
toolchains?~/.rustup/toolchains
. Also I think it'd be good to have the CLI be verbose by default about what it's doing. Even the simple fact thatcargo gpu build
is itself callingcargo build
/rustc
shouldn't be assumed knowledge. It took me a long time to arrive at even the basic understanding I currently have about howrust-gpu
works. So as much as a turnkey solution is a great idea, in my experience hiding all the inner workings wasn't so useful.cargo gpu
namespace, but my first thought was that thegpu
namespace could refer to a lot more than just compiling shaders. I wonder if something likecargo rust-gpu
(whilst redundantly mentioning "rust") might be more appropriate?The text was updated successfully, but these errors were encountered: