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

Consider porting to a language that doesn't require a runtime #34

Open
arilotter opened this issue Oct 30, 2024 · 3 comments
Open

Consider porting to a language that doesn't require a runtime #34

arilotter opened this issue Oct 30, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@arilotter
Copy link

In contexts where you don't require a Python install for other things, including nix-gl-host drags along of python 3 as a ~100mb bump in size.

For example - I have a Rust program that I package into a Docker image, and nix-gl-host ups that image size by 100mb due to its Python dep.
I've ported nix-gl-host to Rust here https://github.com/arilotter/nix-gl-host-rs and it seems to work perfectly!

@arilotter arilotter added the enhancement New feature or request label Oct 30, 2024
@arilotter arilotter changed the title Consider porting to a non-python language Consider porting to a language that doesn't require a runtime Oct 30, 2024
@aim-nara
Copy link

Is that project really working?
I've tried to -p option work( arilotter#1 ) but it's just clearing old nixglhost's cache.

Also is the footprint of python nix-gl-host large?
I've calculated size of my cache(cuda+gl drivers) but it's far more large:

du -sh ~/.cache/nix-gl-host/
3.1G    ~/.cache/nix-gl-host/

And is rust with libc runtime free? You're using patchelf that also requires libc

$ nix-store -q --tree result
/nix/store/g6f6sk3cxfdv01zaj9b46dhfsv9ypbkd-nixglhost-0.1.0
├───/nix/store/5adwdl39g3k9a2j0qadvirnliv4r7pwd-glibc-2.39-52
│   ├───/nix/store/h44h6473all3qkrjjhkm3v0fv63lqyms-libidn2-2.3.7
│   │   ├───/nix/store/f4dfwhawi5kn71k0q1rj296w33i61vp6-libunistring-1.2
│   │   │   └───/nix/store/f4dfwhawi5kn71k0q1rj296w33i61vp6-libunistring-1.2 [...]
│   │   └───/nix/store/h44h6473all3qkrjjhkm3v0fv63lqyms-libidn2-2.3.7 [...]
│   ├───/nix/store/kx9pbw29jml0fgrpkb89f029w25qyxwc-xgcc-13.3.0-libgcc
│   └───/nix/store/5adwdl39g3k9a2j0qadvirnliv4r7pwd-glibc-2.39-52 [...]
├───/nix/store/jfilhsiqdgm4nks2z6labx3iq9qd077a-gcc-13.3.0-lib
│   ├───/nix/store/5adwdl39g3k9a2j0qadvirnliv4r7pwd-glibc-2.39-52 [...]
│   ├───/nix/store/mqnjhrjh72d6i4nn2rr7n6nl24qjjvcs-gcc-13.3.0-libgcc
│   └───/nix/store/jfilhsiqdgm4nks2z6labx3iq9qd077a-gcc-13.3.0-lib [...]
└───/nix/store/ywz6s6bzap4x6yhg2lrx3ibqcnv051c7-patchelf-0.15.0
    ├───/nix/store/5adwdl39g3k9a2j0qadvirnliv4r7pwd-glibc-2.39-52 [...]
    └───/nix/store/jfilhsiqdgm4nks2z6labx3iq9qd077a-gcc-13.3.0-lib [...]

@picnoir
Copy link
Member

picnoir commented Oct 31, 2024

Nice! Porting this to Rust was indeed part of our roadmap!

I sadly don't have any Nvidia GPU anymore to test this :( (See #7 (comment) for more details)

If anybody's willing to take over this project to push it forward, we could definitely move this to nix-communiy and add new maintainers to it.

Ping @Atry @wentasah @SomeoneSerge who also expressed some degree of interest for this project in the past as well.

@arilotter
Copy link
Author

arilotter commented Oct 31, 2024

ah nice catch, I mis-implemented -p. will fix.
it does seem to work for wrapping executables, it lets me run a Nix CUDA application in an Ubuntu docker image :)

Also is the footprint of python nix-gl-host large?

it's about 100mb. I'm golfing all my dependencies down in size and this one seemed easy to tackle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants