mish-cuda icon indicating copy to clipboard operation
mish-cuda copied to clipboard

pytorch1.6 cuda10.2

Open xiaozhangya opened this issue 5 years ago • 9 comments

pytorch1.6 cuda10.2 Can this be installed?

xiaozhangya avatar Nov 03 '20 01:11 xiaozhangya

Yes. I did it. As the library is not on PyPI, you however need to build it yourself.

First install PyTorch 1.6.0 (best in a virtual env) and CUDA 10.2. Make the LD_LIBRARY_PATH point to /usr/local/cuda-10.2/lib64:/usr/local/cuda-10.2/extras/CUPTI/lib64 if not already done. If you have multiple versions of CUDA, do not forget to reset the env variable to its initial value to avoid issues with other projects that would need the default CUDA version installed on your machine. You could also add /usr/local/cuda-10.2/bin to the PATH variable but I'm not sure it's mandatory nor useful.

Then, from the mish-cuda repository, run python setup.py sdist bdist_wheel to build a Wheel file (located in ./dist). You can now either send the Wheel file to your own PyPI instance or just install it in one of your project (with pip install).

Hope this helps.

Bendabir avatar Nov 03 '20 09:11 Bendabir

Just setting LD_LIBRARY_PATH will not properly select the CUDA toolkit if you have multiple versions. PyTorch uses the CUDA_HOME/CUDA_PATH environment variables to locate the CUDA headers and tools. Mismatches between the headers used in compilation and libraries will cause various issues that are hard to diagnose. So make sure those are properly set as well. Or better yet just don't mix CUDA versions.

Also you can just use pip install git+https://github.com/thomasbrandon/mish-cuda/ to install straight from git without needing to create wheels.

thomasbrandon avatar Nov 04 '20 13:11 thomasbrandon

Hi, I use torch=1.6. I use "pip install git+https://github.com/thomasbrandon/mish-cuda/" to install mish-cuda. But it give me an error like: ERROR: Command errored out with exit status 1: command: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-y5wm_mdb

and ERROR: Failed building wheel for mish-cuda and ERROR: Command errored out with exit status 1: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-ivpj2a53/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/ducnm/.local/include/python3.6m/mish-cuda Check the logs for full command output.

How can I solve them? Thanks !

STAROFWIND avatar Dec 14 '20 04:12 STAROFWIND

@thomasbrandon hi,when I try pip install git+https://github.com/thomasbrandon/mish-cuda/or python setup.py -v build , it failed. my torch=1.6.0+cu101 torchvision=0.7.0+cu101 How to solve this problem? 2020-12-30 14-48-55 的屏幕截图

DrewdropLife avatar Dec 30 '20 06:12 DrewdropLife

@changxinC This is related to an incompatability between your system C++ compiler and your CUDA version, It's apparently fixed in CUDA 10.1.168 (according to this). Otherwise upgrading/downgrading your system C++ compiler may fix. Exactly which is easiest will depend a on your distro.

thomasbrandon avatar Dec 30 '20 09:12 thomasbrandon

@changxinC This is related to an incompatability between your system C++ compiler and your CUDA version, It's apparently fixed in CUDA 10.1.168 (according to this). Otherwise upgrading/downgrading your system C++ compiler may fix. Exactly which is easiest will depend a on your distro.

Oh thanks, my CUDA is 10.1.105, g++ is 7.6.5, maybe I need to update the CUDA version.

DrewdropLife avatar Dec 30 '20 11:12 DrewdropLife

Hi, I use torch=1.6. I use "pip install git+https://github.com/thomasbrandon/mish-cuda/" to install mish-cuda. But it give me an error like: ERROR: Command errored out with exit status 1: command: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-y5wm_mdb

and ERROR: Failed building wheel for mish-cuda and ERROR: Command errored out with exit status 1: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-ivpj2a53/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/ducnm/.local/include/python3.6m/mish-cuda Check the logs for full command output.

How can I solve them? Thanks !

I got the same problem. Not sure if you have resolved it? Thanks.

wuy66 avatar Jul 11 '21 05:07 wuy66

Hi, I use torch=1.6. I use "pip install git+https://github.com/thomasbrandon/mish-cuda/" to install mish-cuda. But it give me an error like: ERROR: Command errored out with exit status 1: command: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-y5wm_mdb and ERROR: Failed building wheel for mish-cuda and ERROR: Command errored out with exit status 1: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-ivpj2a53/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/ducnm/.local/include/python3.6m/mish-cuda Check the logs for full command output. How can I solve them? Thanks !

I got the same problem. Not sure if you have resolved it? Thanks.

Instead of installing it, I just defined a class that implements mish by pytorch.

DrewdropLife avatar Jul 12 '21 02:07 DrewdropLife

Hi, I use torch=1.6. I use "pip install git+https://github.com/thomasbrandon/mish-cuda/" to install mish-cuda. But it give me an error like: ERROR: Command errored out with exit status 1: command: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-y5wm_mdb and ERROR: Failed building wheel for mish-cuda and ERROR: Command errored out with exit status 1: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-ivpj2a53/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/ducnm/.local/include/python3.6m/mish-cuda Check the logs for full command output. How can I solve them? Thanks !

I got the same problem. Not sure if you have resolved it? Thanks.

Instead of installing it, I just defined a class that implements mish by pytorch.

Thank you. I figured the same thing lol

wuy66 avatar Jul 12 '21 05:07 wuy66