-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
conda-build may raise false alarm on Windows? #13
Comments
In the Linux case, we don't see issues as libraries link to the symlinks in If we look at the Linux case, we see something like the following
It doesn't warn here as the the library links to the SO symlinks, which ship with Interestingly cuda-cudart-feedstock/recipe/meta.yaml Lines 68 to 70 in d6fd097
|
One option would be to modify cuda-cudart-feedstock/recipe/meta.yaml Lines 104 to 106 in d6fd097
...to include... - {{ pin_subpackage("cuda-cudart_" + target_platform, max_pin="x") }} This is a bit redundant Also not sure offhand if this would have other consequences. It could be restricted to Windows Maybe there are better solutions |
conda-build warning is correct. |
What would happen to In the Linux case those are just symlinks, the actual files are in AIUI this structure was used for cross-compilation support |
I am seeing this same error on the libmagma-feedstock. Except on the libmagma feedstock, the warning is promoted to an error. |
It's not needed as we don't do cross-compilation for windows. |
Thought we wanted to avoid special casing for Windows though ( conda-forge/staged-recipes#21723 (comment) ) Currently am seeing the following:
If we start dropping the various Am wondering whether this is worth it to avoid a warning What other options might we have that would involve fewer touch points? |
We could try to get symlinks working for the Windows package like they do for Linux. According to this blog post from 2016, you no longer need admin priviledge to create symlinks in Windows 10, but you may need to enable "Developer Mode". I'm not sure whether "Developer Mode" is enabled on the Azure workers. |
I prototyped using relative Symlinks on Windows to mirror how the Linux packages work. Unfortunately, it seems that conda does not handle installting symlinks on Windows correctly.
It's weird because if I unpack the archives manually, the symlinks seem to be intact, so I'm not sure what's up. There are some other open issues related to links on Windows, though. |
Sorry, but I think I'm not quite following the proposal, Daniel How would symlinks be used here (assuming we could get them to work)? |
I think @carterbox might be proposing to match the behavior on Linux. That is, symlink from the targets folder (provided by the cuda-cudart_win-* package(s)) to %PREFIX%/Library/bin. Unfortunately, symlinks on Windows are still a dumpster fire that we can't rely on. Beyond that, there's myriad code built around the assumption that symlinks don't work, so it would be a major effort to support them. Requiring users to change to "developer mode" or whatever is just too much to ask, unfortunately. I agree that we need to avoid special casing on Windows. Even if we decide to throw cross-compiling out the window on all OSes, NVIDIA still wants to keep the My inclination is to follow @jakirkham suggestion at #13 (comment), assuming that it works to fix the issue. If this affected only one consumer package, I'd just ignore the warning/error with a Conda-build option. Since this seems like it will affect any package using CUDA, we need a less ignorant approach. |
Yes, exactly.
For clarity, my understanding is the "Developer Mode" is only required for creating new links, not using them once they exist, so I don't think it would require every Conda user to enable "Developer Mode" only creators of packages that contain symlinks. No comment on the usability/reliability of symlinks once they are created. Why don't we just create copies instead of symlinks? That way the library is in the right place for runtime and also is available for cross-compiling if/when Windows ARM gains support for CUDA. With copy instead of link, we might also trim some dependencies, so that end users don't download two copies of the same file. |
Copies are probably a good option here given this should only be required for cudart. Would we need to duplicate |
Whether symlinks or copies, am not sure this makes sense in the Windows case as we don't have a At least atm, am leaning towards the |
The upstream Windows package doesn't have "targets", but it does have a "lib\x64" folder. I assumed that the corresponding hypothetical arm package would have an "lib\arm64" folder. It's just that in this conda recipe the contents of "lib/x64" is unpacked directly into "lib". So I guess my proposal is to have two copies of whatever files. One in "lib" and the others in "lib\x64" and/or "lib\arm64". I also just realized that the Windows artifacts in this recipe are probably incorrectly split because of differences between how Unix and Windows artifacts are used: UNIX: WINDOWS: Thus to support the cross-compiling for Windows, the artifact split should be a bit different from unix since DLLs are not needed for cross-compile, but the LIB files are? Thus, the DLL should only appear in the native package, while the LIB file should be copied/linked and appear in cross-compile packages, so something like this: # This package is runtime deps for native, we only need DLL at runtime
- name: cuda-cudart
files:
- lib/libcu*.so.* # [linux]
- Library\bin\cudart*.dll # [win]
# This package is compile/link deps for native; we need LIB and header files, let's dump they directly into lib\
- name: cuda-cudart-dev
build:
run_exports:
- {{ pin_subpackage("cuda-cudart", max_pin="x") }}
files:
- lib/libcu*.so # [linux]
- lib/pkgconfig # [linux]
- Library\lib\cuda*.lib # [win]
# This package is compile/link deps for cross-compile; we need LIB and header files keep the LIB files in their target subdirectory
- name: cuda-cudart-dev_{{ target_platform }}
build:
noarch: generic
run_exports:
- {{ pin_subpackage("cuda-cudart", max_pin="x") }}
files:
- targets/{{ target_name }}/include # [linux]
- targets/{{ target_name }}/lib/*.so # [linux]
- Library\include # [win]
- Library\lib\{{ target_name }}\cudart*.lib # [win]
# This package is compile/link deps for cross-compile; unused by Windows because you wouldn't use DLLs when target != host
- name: cuda-cudart_{{ target_platform }}
build:
noarch: generic
files:
- targets/{{ target_name }}/lib/libcu*.so.* # [linux] The only thing that confuses me is whether headers are target specific as they seem to be fore unix. |
During the testing of CUDA 12 + Windows (conda-forge/cupy-feedstock#228), we see this warning
which seems to be saying we missed a
run_exports
somewhere in packages generated from this feedstock, but it's not the case.cuda-cudart_win-64
is installed in both build and test stages just fine. Also, there's no problem on Linux, and the export relation (cuda-cudart-dev
exportingcuda-cudart
that depends oncuda-cudart_{{ platform }}
) is the same on both OS. Seems like a false alarm that can be safely ignored.The text was updated successfully, but these errors were encountered: