I just tried that and it returns:
ERROR: Could not find a version that satisfies the requirement torch==2.0.1 (from versions: 2.2.0, 2.2.1, 2.2.2, 2.3.0)
ERROR: No matching distribution found for torch=2.0.1
After installing pytorce 2.0.1 and python 3.10 now the same code in OP returns this:
CUDA Available: False
Traceback (most recent call last):
File “…\Desktop\import torch.py”, line 3, in
print("CUDA Device Name: “, torch.cuda.get_device_name(0))
File “…\LocalCache\local-packages\Python310\site-packages\torch\cuda_init_.py”, line 365, in get_device_name
return get_device_properties(device).name
File “…\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\cuda_init_.py”, line 395, in get_device_properties
_lazy_init() # will define get_device_properties
File "…\LocalCache\local-packages\Python310\site-packages\torch\cuda_init.py”, line 239, in _lazy_init
raise AssertionError(“Torch not compiled with CUDA enabled”)
AssertionError: Torch not compiled with CUDA enabled
I checked the code inside RVC they are using the same code to see if cuda is available. So I just went back to install:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
and then cuda 12.1 again because installing other ones seem to change the default cuda, but still same error as “AssertionError: Torch not compiled with CUDA enabled”
You guys said cuda binaries ship with pytorch so that means you don’t really need to install cuda from nvidia website at all?
The only difference now is that I don’t use python 3.12.3 but python 3.10.
Uninstalling all pytorch and components and reinstalling I get different error. So just installing with new pip commands do not do the right things? We have to uninstall each time to be sure?
In any case I get the shm error which I thought was fixed:
“local-packages\Python310\site-packages\torch\lib\shm.dll” or one of its dependencies."
The shm issue was reported for 2.3.0 as seen in the linked issue so you can either install the fixed nightly or apply a workaround suggested in the GitHub issue for your current installation.
Thanks a lot that works. Can you confirm an uninstall is necessary for it to update the files correctly? Because if I didn’t uninstall all pytorch stuff, and just call the new nightly pip install command, i still get the same error. but after uninstall and reinstall it works.
This is what I always do. Users have reported that “updating” PyTorch might work, but I’m always uninstalling it before installing a new stable or nightly release as it’ll pull all dependencies anyway.
I’m not familiar with the fbgemm issue but the linked post seems to suggest installing VS fixes it.