PufferLib icon indicating copy to clipboard operation
PufferLib copied to clipboard

`win64_msvc16` - `puffer_target`

Open elevatorguy opened this issue 7 months ago • 4 comments

Populate extra_compile_args and extra_link_args as needed.


Regarding symlink(s) - resources:

D:\puffer>fsutil behavior query symlinkevaluation
Local-to-local symbolic link evaluation is: ENABLED
Local-to-remote symbolic link evaluation is: DISABLED
Remote-to-local symbolic link evaluation is: DISABLED
Remote-to-remote symbolic link evaluation is: DISABLED
Directory of C:\Program Files (x86)\Intel\oneAPI\dpl\2022.9\windows

09/23/2025  08:32 AM    <DIR>          .
09/23/2025  08:32 AM    <DIR>          ..
09/23/2025  08:32 AM    <SYMLINKD>     include [C:\Program Files (x86)\Intel\oneAPI\dpl\2022.9\include]

For puffer, config and resources don't have the above SYMLINKD status.

Trying git config core.symlinks true:

D:\puffer>git status
On branch local
Your branch is up to date with 'fork/local'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        typechange: config
        typechange: resources

no changes added to commit (use "git add" and/or "git commit -a")

D:\puffer>git restore resources
error: unable to create symlink resources: Permission denied

D:\puffer>git restore config
error: unable to create symlink config: Permission denied

Doesn't block training of puffer_target, but shows W0918 08:32:43.886000 5792 site-packages\torch\distributed\elastic\multiprocessing\redirects.py:29] NOTE: Redirects are currently not supported in Windows or MacOs. above initial draw of puffer dash - using 2.8.0+xpu as pytorch version - and one dialog box.

file

elevatorguy avatar Jun 16 '25 13:06 elevatorguy

Error after modifying pufferl.py:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
    from multiprocessing.spawn import spawn_main; spawn_main(parent_pid=3204, pipe_handle=1408)
                                                  ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jayg8\AppData\Local\Programs\Python\Python313\Lib\multiprocessing\spawn.py", line 122, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "C:\Users\jayg8\AppData\Local\Programs\Python\Python313\Lib\multiprocessing\spawn.py", line 132, in _main
    self = reduction.pickle.load(from_parent)
  File "D:\puffer\pufferlib\ocean\target\target.py", line 7, in <module>
    from pufferlib.ocean.target import binding
ImportError: DLL load failed while importing binding: The specified module could not be found.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    from multiprocessing.spawn import spawn_main; spawn_main(parent_pid=3204, pipe_handle=1328)
                                                  ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jayg8\AppData\Local\Programs\Python\Python313\Lib\multiprocessing\spawn.py", line 122, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "C:\Users\jayg8\AppData\Local\Programs\Python\Python313\Lib\multiprocessing\spawn.py", line 132, in _main
    self = reduction.pickle.load(from_parent)
  File "D:\puffer\pufferlib\ocean\target\target.py", line 7, in <module>
    from pufferlib.ocean.target import binding
ImportError: DLL load failed while importing binding: The specified module could not be found.

(as pufferl.py isn't in the execution path like environment.py is)

elevatorguy avatar Jun 16 '25 22:06 elevatorguy

D:\puffer>

Python - pufferlib/ocean/target/target.py or elsewhere:

is_resource = not(os.path.exists("pufferlib"))
if is_resource:
    resource_path = "resources/..."
else:
    resource_path = "pufferlib/resources/..."

C - somewhere not per env: //TODO - file handling (eg. like this, but better)

May be raylib issue; LoadTexture using relative instead of absolute path - see pufferlib/ocean/environment.py.

Real problem is that resources is supposed to be a symlink to pufferlib/resources. PufferLib users should either enable symlink support on their device (sounds like if you have admin you can enable dev mode to make this work?) or replace the symlink with a directory junction to get this working. I don't think it makes sense to modify the code as a workaround (unless we're going to switch all resources to pufferlib/resources or a "base path" variable).

KTibow avatar Sep 27 '25 00:09 KTibow

Testing which changes are actually necessary:

  • GitHub Workflows change is currently problematic (because most envs don't use msvc-style C)
  • env_binding change seems out of scope and unneeded (I think)
  • environment.py change is genuinely needed (bindings won't import correctly otherwise)
  • pufferl.py change is genuinely needed (svmem only has active on unixlike)
  • gitignore change seems out of scope and also oddly setup (raylib* already exists, so the # Raylib section is redundant)
  • All setup.py changes aside from .replace('\\', '.') are genuinely needed

KTibow avatar Sep 29 '25 21:09 KTibow

Perhaps 8bcc454; not necessarily out-of-scope - may be needed.

elevatorguy avatar Oct 02 '25 14:10 elevatorguy