Autodesk / Aurora

Real-time GPU path tracing with a USD Hydra render delegate
Apache License 2.0
473 stars 30 forks source link

"The directory name is invalid" when using deployHdAurora.py for USD building #13

Closed oumad closed 1 year ago

oumad commented 1 year ago

The script deployHdAurora.py fails at the step where it tries to build USD, it throws the error :

- Building USD.
Traceback (most recent call last):
  File "Scripts/deployHdAurora.py", line 82, in <module>
    if(subprocess.run(["python", "./build_scripts/build_usd.py", "--python", args.usd_root], cwd=usd_repo_root).returncode != 0):
  File "C:\Users\Mohamed\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 488, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Users\Mohamed\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "C:\Users\Mohamed\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1207, in _execute_child
    startupinfo)
NotADirectoryError: [WinError 267] The directory name is invalid

When looking at all the paths provided to the subprocess function, I found that the issue is with the USD repo, in my case the repo directory is named this way (with all the build steps I followed initially) : C:\dev\AuroraExternals\src\USD-22.08-Aurora-v22.11, while the line 64 in deployHdAurora.py has this :

usd_repo_root = os.path.join(externals_folder, "src", "USD")

Which produces a path like this : C:\dev\AuroraExternals\src\USD. So I had to change that line this way for the script to work for me :

usd_repo_root = os.path.join(externals_folder, "src", "USD-22.08-Aurora-v22.11")

Is there a way to better generalize this in the script as opposed to hard coding the USD version ? or maybe it's not an issue I should've faced? I'll gladly submit a PR too if needed.

ZhongLingXiao commented 1 year ago

I have add a pull request for this issue : [fix] Fail to find USD folder when using deployHdAurora.py. #8

    # usd_repo_root = os.path.join(externals_folder,"src","USD")
    # find usd src folder : e.g. USD-22.08-Aurora-v22.11
    usd_paths = [f.name for f in os.scandir(os.path.join(externals_folder,"src")) if f.is_dir() and f.name.startswith("USD-")]
    if (len(usd_paths)==0):
        raise Exception("[Error] Fail to find usd folder.")
    if (len(usd_paths)>1):
        print("[Warning] More than one usd folders, use {}.".format(usd_paths[0]))
    usd_repo_root = os.path.join(externals_folder,"src", usd_paths[0])
oumad commented 1 year ago

I have add a pull request for this issue : [fix] Fail to find USD folder when using deployHdAurora.py. #8

    # usd_repo_root = os.path.join(externals_folder,"src","USD")
    # find usd src folder : e.g. USD-22.08-Aurora-v22.11
    usd_paths = [f.name for f in os.scandir(os.path.join(externals_folder,"src")) if f.is_dir() and f.name.startswith("USD-")]
    if (len(usd_paths)==0):
        raise Exception("[Error] Fail to find usd folder.")
    if (len(usd_paths)>1):
        print("[Warning] More than one usd folders, use {}.".format(usd_paths[0]))
    usd_repo_root = os.path.join(externals_folder,"src", usd_paths[0])

Apologies, I should've looked at the PRs first ! Actually scanning the directory and partially matching USD string was what I had in mind initially, but I was hoping there was a more simple/clean way to do it.

andy-shiue-autodesk commented 1 year ago

This issue should be fixed in v22.12. There are some big changes in how the externals are built. You would need to have a clean run of installExternals.py (i.e. remove the old externals and run the script again). Changes of the build steps were updated in README.md . Let us know if you run into any issues.