update GPU script
This commit is contained in:
parent
ff31d3c62d
commit
d55436e1ea
|
@ -1,10 +1,9 @@
|
|||
package libtch
|
||||
|
||||
// #cgo LDFLAGS: -lstdc++ -ltorch -lc10 -ltorch_cpu -L/opt/libtorch/lib
|
||||
// #cgo LDFLAGS: -lstdc++ -ltorch -lc10 -ltorch_cpu
|
||||
// #cgo LDFLAGS: -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcudnn -lcaffe2_nvrtc -lnvrtc-builtins -lnvrtc -lnvToolsExt -lc10_cuda -ltorch_cuda
|
||||
// #cgo CFLAGS: -I${SRCDIR} -O3 -Wall -Wno-unused-variable -Wno-deprecated-declarations -Wno-c++11-narrowing -g -Wno-sign-compare -Wno-unused-function
|
||||
// #cgo CFLAGS: -D_GLIBCXX_USE_CXX11_ABI=1
|
||||
// #cgo CFLAGS: -I/usr/local/cuda/include
|
||||
// #cgo CXXFLAGS: -std=c++17 -I${SRCDIR} -g -O3
|
||||
// #cgo CXXFLAGS: -I/opt/libtorch/lib -I/opt/libtorch/include -I/opt/libtorch/include/torch/csrc/api/include
|
||||
import "C"
|
||||
|
|
10
libtch/lib.go.gpu
Normal file
10
libtch/lib.go.gpu
Normal file
|
@ -0,0 +1,10 @@
|
|||
package libtch
|
||||
|
||||
// #cgo LDFLAGS: -lstdc++ -ltorch -lc10 -ltorch_cpu -L/opt/libtorch/lib
|
||||
// #cgo LDFLAGS: -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcudnn -lcaffe2_nvrtc -lnvrtc-builtins -lnvrtc -lnvToolsExt -lc10_cuda -ltorch_cuda
|
||||
// #cgo CFLAGS: -I${SRCDIR} -O3 -Wall -Wno-unused-variable -Wno-deprecated-declarations -Wno-c++11-narrowing -g -Wno-sign-compare -Wno-unused-function
|
||||
// #cgo CFLAGS: -D_GLIBCXX_USE_CXX11_ABI=1
|
||||
// #cgo CFLAGS: -I/usr/local/cuda/include
|
||||
// #cgo CXXFLAGS: -std=c++17 -I${SRCDIR} -g -O3
|
||||
// #cgo CXXFLAGS: -I/opt/libtorch/lib -I/opt/libtorch/include -I/opt/libtorch/include/torch/csrc/api/include
|
||||
import "C"
|
|
@ -1,6 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
sudo rm -rf /opt/libtorch
|
||||
wget -O /tmp/libtorch-cxx11-abi-shared-with-deps-1.5.1+cpu.zip https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.5.1%2Bcpu.zip
|
||||
unzip /tmp/libtorch-cxx11-abi-shared-with-deps-1.5.1+cpu.zip -d /opt
|
||||
sudo echo LD_LIBRARY_PATH=/opt/libtorch/lib:/usr/lib64-nvidia:/usr/local/cuda-10.1/lib64 >> $HOME/.bashrc
|
||||
export GOTCH_VERSION="v0.1.0"
|
||||
export LIBTORCH="$GOPATH/pkg/mod/github.com/sugarme/gotch@{GOTCH_VERSION}/libtch"
|
||||
export LIBRARY_PATH=$LIBTORCH/lib
|
||||
export CPATH=$CPATH:$LIBTORCH/lib:$LIBTORCH/include:$LIBTORCH/include/torch/csrc/api/include
|
||||
export LD_LIBRARY_PATH=$LIBTORCH/lib:/usr/lib64-nvidia:/usr/local/cuda-10.1/lib64
|
||||
|
||||
sudo rm -rf $LIBTORCH
|
||||
mkdir -p $LIBTORCH
|
||||
wget -O /tmp/libtorch-cxx11-abi-shared-with-deps-1.5.1%2Bcu101.zip https://download.pytorch.org/libtorch/cu101/libtorch-cxx11-abi-shared-with-deps-1.5.1%2Bcu101.zip
|
||||
unzip /tmp/libtorch-cxx11-abi-shared-with-deps-1.5.1%2Bcu101.zip -d $LIBTORCH
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user