Conflict in pytorch CUDA version and space CUDA version

Hi there.

I have this space that worked perfectly weeks ago.

It seems previously HF spaces were using cuda 11.3, and it worked well with the pytorch version in my space, I used the following lines at the beginning of requirements.txt:

--extra-index-url https://download.pytorch.org/whl/cu113
torch==1.10.0+cu113
torchvision==0.11.0+cu113

and at the beginning of app.py I installed the tiny-cuda-nn package with:

os.system('pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch')

It worked well several months ago. But recently I found the space are using CUDA12.3, and it will cause an error when installing the tiny-cuda-nn as the system cuda version and compiled pytorch cuda version don’t match:

The detected CUDA version (12.3) mismatches the version that was used to compile PyTorch (11.3). Please make sure to use the same CUDA versions

Is there any solution to this? For example set the default CUDA version of this space as 11.3? On pytorch documentation I can’t find one version specific for CUDA12.3, especially when I still want to use pytorch 1.x in this space.

Thanks

1 Like