-
-
Save zhanwenchen/ada29fd8a44ee69d3f766a95ac317b21 to your computer and use it in GitHub Desktop.
Revisions
-
zhanwenchen revised this gist
Aug 9, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export CONDA_LIB=${CONDA_PREFIX}/lib # be careful here; they didn't accept sm_89 so I had to round it down to major version, sm_80 make clean && rm -rf build/ TARGETARCH=amd64 cmake -H. -Bbuild -DUSE_FORTRAN=OFF -DGPU_TARGET="Ampere" -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_C_FLAGS="-fPIC" -DMKLROOT=${CONDA_PREFIX} -DCUDA_NVCC_FLAGS="-Xfatbin;-compress-all;-DHAVE_CUBLAS;-std=c++11;--threads=0;" -GNinja sudo mkdir /usr/local/magma/ ``` -
zhanwenchen revised this gist
Aug 9, 2023 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -49,7 +49,6 @@ make generate export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${CONDA_PREFIX}/lib:/usr/local/cuda/targets/x86_64-linux/lib" export CUDA_DIR="/usr/local/cuda-12.2" export CONDA_LIB=${CONDA_PREFIX}/lib # be careful here; they didn't accept sm_89 so I had to round it down to major version, sm_80 make clean && rm -rf build/ -
zhanwenchen revised this gist
Aug 9, 2023 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -72,12 +72,14 @@ Install Magma: ```bash cp build/include/* ${CONDA_PREFIX}/include/ cp build/lib/*.so ${CONDA_PREFIX}/lib/ cp build/lib/*.a ${CONDA_PREFIX}/lib/ cp build/lib/pkgconfig/*.pc ${CONDA_PREFIX}/lib/pkgconfig/ sudo cp /usr/local/magma/include/* ${CONDA_PREFIX}/include/ sudo cp /usr/local/magma/lib/pkgconfig/*.pc ${CONDA_PREFIX}/lib/pkgconfig/ sudo cp build/include/* /usr/local/include/ sudo cp build/lib/*.so /usr/local/lib/ sudo cp build/lib/*.a /usr/local/lib/ sudo cp build/lib/pkgconfig/*.pc /usr/lib/pkgconfig sudo cp /usr/local/magma/include/* /usr/local/include/ sudo cp /usr/local/magma/lib/pkgconfig/*.pc /usr/lib/pkgconfig -
zhanwenchen revised this gist
Aug 9, 2023 . No changes.There are no files selected for viewing
-
zhanwenchen revised this gist
Aug 9, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -65,7 +65,7 @@ mkl_intel_thread Build Magma: ```bash #sudo cmake --build build --target install && rm -r ./build # buildkit" sudo cmake --build build -j $(nproc) --target install ``` Install Magma: -
zhanwenchen revised this gist
Aug 9, 2023 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -57,15 +57,14 @@ make clean && rm -rf build/ TARGETARCH=amd64 cmake -H. -Bbuild -DUSE_FORTRAN=OFF -DGPU_TARGET="Ampere" -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_C_FLAGS="-fPIC" -DMKLROOT=${CONDA_PREFIX} -DCUDA_NVCC_FLAGS="-Xfatbin;-compress-all;-DHAVE_CUBLAS;-std=c++11;--threads=0;" -GNinja sudo mkdir /usr/local/magma/ ``` mkl_intel_thread Build Magma: ```bash #sudo cmake --build build --target install && rm -r ./build # buildkit" cmake --build build -j $(nproc) --target install ``` -
zhanwenchen revised this gist
Aug 9, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -58,7 +58,7 @@ TARGETARCH=amd64 cmake -H. -Bbuild -DUSE_FORTRAN=OFF -DGPU_TARGET="Ampere" -DBUI sudo mkdir /usr/local/magma/ sudo cmake --build build --target install && rm -r ./build # buildkit" ``` mkl_intel_thread -
zhanwenchen revised this gist
Aug 9, 2023 . 1 changed file with 0 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -39,8 +39,6 @@ conda install -c intel intelpython3_full python=3.10 mkl-dpcpp mkl-include cmake conda install astunparse expecttest hypothesis numpy psutil pyyaml requests setuptools typing-extensions sympy filelock networkx jinja2 fsspec pip install types-dataclasses ``` Configure Magma (see [README](https://bitbucket.org/icl/magma/src/master/README)): @@ -56,9 +54,6 @@ export CONDA_LIB=${CONDA_PREFIX}/lib # be careful here; they didn't accept sm_89 so I had to round it down to major version, sm_80 make clean && rm -rf build/ TARGETARCH=amd64 cmake -H. -Bbuild -DUSE_FORTRAN=OFF -DGPU_TARGET="Ampere" -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_C_FLAGS="-fPIC" -DMKLROOT=${CONDA_PREFIX} -DCUDA_NVCC_FLAGS="-Xfatbin;-compress-all;-DHAVE_CUBLAS;-std=c++11;--threads=0;" -GNinja sudo mkdir /usr/local/magma/ -
zhanwenchen revised this gist
Aug 9, 2023 . 1 changed file with 3 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,18 +32,13 @@ echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt sudo apt update conda create -n ietrans conda activate ietrans # As of writing, intel python 3.11 has not been released yet. conda install -c intel intelpython3_full python=3.10 mkl-dpcpp mkl-include cmake ninja intel-extension-for-pytorch intel-openmp intel-fortran-rt dpcpp-cpp-rt conda install astunparse expecttest hypothesis numpy psutil pyyaml requests setuptools typing-extensions sympy filelock networkx jinja2 fsspec pip install types-dataclasses ``` -
zhanwenchen revised this gist
Aug 9, 2023 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -85,10 +85,11 @@ cp build/include/* ${CONDA_PREFIX}/include/ cp build/lib/*.so ${CONDA_PREFIX}/lib/ cp build/lib/pkgconfig/*.pc ${CONDA_PREFIX}/lib/pkgconfig/ sudo cp /usr/local/magma/include/* ${CONDA_PREFIX}/include/ sudo cp /usr/local/magma/lib/pkgconfig/*.pc ${CONDA_PREFIX}/lib/pkgconfig/ sudo cp build/include/* /usr/local/include/ sudo cp build/lib/*.so /usr/local/lib/ sudo cp build/lib/pkgconfig/*.pc /usr/lib/pkgconfig sudo cp /usr/local/magma/include/* /usr/local/include/ sudo cp /usr/local/magma/lib/pkgconfig/*.pc /usr/lib/pkgconfig ``` -
zhanwenchen revised this gist
Aug 9, 2023 . 1 changed file with 1 addition and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,15 +50,10 @@ conda install astunparse expecttest hypothesis numpy psutil pyyaml requests setu Configure Magma (see [README](https://bitbucket.org/icl/magma/src/master/README)): ```bash echo -e "GPU_TARGET = sm_86\nBACKEND = cuda\nFORT = false" > make.inc make generate export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${CONDA_PREFIX}/lib:/usr/local/cuda/targets/x86_64-linux/lib" export CUDA_DIR="/usr/local/cuda-12.2" export CONDA_LIB=${CONDA_PREFIX}/lib #export LD_PRELOAD="${CONDA_PREFIX}/lib/libiomp5.so" -
zhanwenchen revised this gist
Aug 9, 2023 . No changes.There are no files selected for viewing
-
zhanwenchen revised this gist
Aug 9, 2023 . 1 changed file with 10 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -86,11 +86,14 @@ cmake --build build -j $(nproc) --target install Install Magma: ```bash cp build/include/* ${CONDA_PREFIX}/include/ cp build/lib/*.so ${CONDA_PREFIX}/lib/ cp build/lib/pkgconfig/*.pc ${CONDA_PREFIX}/lib/pkgconfig/ sudo cp /usr/local/magma/include/* ${CONDA_PREFIX}/include/ #sudo cp /usr/local/magma/lib/*.so ${CONDA_PREFIX}/lib/ sudo cp /usr/local/magma/lib/pkgconfig/*.pc ${CONDA_PREFIX}/lib/pkgconfig/ #sudo cp build/target/include/* /usr/local/include/ #sudo cp build/target/lib/*.so /usr/local/lib/ #sudo cp build/target/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/ ``` -
zhanwenchen revised this gist
Aug 9, 2023 . 1 changed file with 14 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -61,13 +61,19 @@ make generate export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:/usr/local/cuda/targets/x86_64-linux/lib" export CUDA_DIR="/usr/local/cuda-12.2" export CONDA_LIB=${CONDA_PREFIX}/lib #export LD_PRELOAD="${CONDA_PREFIX}/lib/libiomp5.so" # be careful here; they didn't accept sm_89 so I had to round it down to major version, sm_80 make clean && rm -rf build/ #TARGETARCH=amd64 cmake -H. -Bbuild -DUSE_FORTRAN=OFF -DGPU_TARGET="Ampere" -DCMAKE_CUDA_COMPILER="$CUDA_DIR/bin/nvcc" -DMKLROOT=${CONDA_PREFIX} -DLIBS="${CONDA_LIB}/libmkl_intel_lp64.so;${CONDA_LIB}/libmkl_intel_thread.so;${CONDA_LIB}/libmkl_core.so;${CONDA_LIB}/libiomp5.so;-lm;-ldl" -DLAPACK_LIBRARIES=${CONDA_LIB}/libmkl_intel_lp64.so;${CONDA_LIB}/libmkl_intel_thread.so;/${CONDA_LIB}/libmkl_core.so;${CONDA_LIB}/libiomp5.so;-lm;-ldl;-lm;-ldl" -DCUDA_NVCC_FLAGS="-Xfatbin;-compress-all;-DHAVE_CUBLAS;-std=c++11;--threads=0;" -GNinja TARGETARCH=amd64 cmake -H. -Bbuild -DUSE_FORTRAN=OFF -DGPU_TARGET="Ampere" -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_C_FLAGS="-fPIC" -DMKLROOT=${CONDA_PREFIX} -DCUDA_NVCC_FLAGS="-Xfatbin;-compress-all;-DHAVE_CUBLAS;-std=c++11;--threads=0;" -GNinja sudo mkdir /usr/local/magma/ cmake --build build --target install && rm -r ./build # buildkit" ``` mkl_intel_thread @@ -80,6 +86,10 @@ cmake --build build -j $(nproc) --target install Install Magma: ```bash cp build/target/include/* ${CONDA_PREFIX}/include/ cp build/target/lib/*.so ${CONDA_PREFIX}/lib/ cp build/target/lib/pkgconfig/*.pc ${CONDA_PREFIX}/lib/pkgconfig/ sudo cp build/target/include/* /usr/local/include/ sudo cp build/target/lib/*.so /usr/local/lib/ sudo cp build/target/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/ -
zhanwenchen revised this gist
Aug 9, 2023 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,7 +41,9 @@ conda create -n ietrans conda activate ietrans conda config --env --add channels intel # As of writing, intel python 3.11 has not been released yet. conda install intelpython3_full python=3.10 mkl-dpcpp mkl-include cmake ninja intel-extension-for-pytorch intel-openmp intel-fortran-rt dpcpp-cpp-rt conda install astunparse expecttest hypothesis numpy psutil pyyaml requests setuptools types-dataclasses typing-extensions sympy filelock networkx jinja2 fsspec ``` -
zhanwenchen revised this gist
Aug 7, 2023 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -56,16 +56,21 @@ echo -e "GPU_TARGET = sm_86\nBACKEND = cuda\nFORT = false" > make.inc make generate export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:/usr/local/cuda/targets/x86_64-linux/lib" export CUDA_DIR="/usr/local/cuda-12.2" export CONDA_LIB=${CONDA_PREFIX}/lib export LD_PRELOAD="${CONDA_PREFIX}/lib/libiomp5.so" # be careful here; they didn't accept sm_89 so I had to round it down to major version, sm_80 make clean && rm -rf build && \ cmake -DGPU_TARGET=Ampere -DCMAKE_CUDA_COMPILER="$CUDA_DIR/bin/nvcc" -DMKLROOT=${CONDA_PREFIX} -DLIBS="/localtmp/pct4et/conda_envs/ietrans/lib/libmkl_intel_lp64.so;/localtmp/pct4et/conda_envs/ietrans/lib/libmkl_intel_thread.so;/localtmp/pct4et/conda_envs/ietrans/lib/libmkl_core.so;/localtmp/pct4et/conda_envs/ietrans/lib/libiomp5.so;-lm;-ldl" -DLAPACK_LIBRARIES="/localtmp/pct4et/conda_envs/ietrans/lib/libmkl_intel_lp64.so;/localtmp/pct4et/conda_envs/ietrans/lib/libmkl_intel_thread.so;/localtmp/pct4et/conda_envs/ietrans/lib/libmkl_core.so;/localtmp/pct4et/conda_envs/ietrans/lib/libiomp5.so;-lm;-ldl;-lm;-ldl" . -Bbuild ``` mkl_intel_thread Build Magma: ```bash cmake --build build -j $(nproc) --target install -
zhanwenchen revised this gist
Aug 7, 2023 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -62,7 +62,8 @@ export CUDA_DIR="/usr/local/cuda-12.2" export LD_PRELOAD="${CONDA_PREFIX}/lib/libiomp5.so" # be careful here; they didn't accept sm_89 so I had to round it down to major version, sm_80 make clean && rm -rf build && \ cmake -DGPU_TARGET=Ampere -DCMAKE_CUDA_COMPILER="$CUDA_DIR/bin/nvcc" -DMKLROOT=${CONDA_PREFIX} -DCMAKE_INSTALL_PREFIX=build/target -DCMAKE_C_FLAGS="-liomp5 -fopenmp -lpthread -L${CONDA_PREFIX}/lib" -DCMAKE_CXX_FLAGS="-liomp5 -fopenmp -lpthread -L${CONDA_PREFIX}/lib" -DCMAKE_Fortran_FLAGS="-I${MKLROOT}/include -liomp5 -L${MKLROOT}/lib/ -lmkl_core -lmkl_gnu_thread -lmkl_gf_lp64" -DOpenMP_C_LIB_NAMES="libiomp5" -DOpenMP_CXX_LIB_NAMES="libiomp5" -DOpenMP_libiomp5_LIBRARY=${CONDA_PREFIX}/lib/libiomp5.so" . -Bbuild ``` Build Magma: -
zhanwenchen revised this gist
Aug 7, 2023 . 1 changed file with 11 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,20 +32,16 @@ echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt sudo apt update #sudo apt install intel-basekit intel-aikit # Source the Intel oneAPI #. /opt/intel/oneapi/setvars.sh conda create -n ietrans conda activate ietrans conda config --env --add channels intel # As of writing, intel python 3.11 has not been released yet. conda install intelpython3_full python=3.10 mkl-dpcpp mkl-include cmake ninja intel-extension-for-pytorch intel-openmp intel-fortran-rt dpcpp-cpp-rt ``` @@ -58,10 +54,15 @@ Configure Magma (see [README](https://bitbucket.org/icl/magma/src/master/README) echo -e "GPU_TARGET = sm_86\nBACKEND = cuda\nFORT = false" > make.inc make generate export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:/usr/local/cuda/targets/x86_64-linux/lib" export CUDA_DIR="/usr/local/cuda-12.2" export LD_PRELOAD="${CONDA_PREFIX}/lib/libiomp5.so" # be careful here; they didn't accept sm_89 so I had to round it down to major version, sm_80 make clean && rm -rf build && cmake -DGPU_TARGET=Ampere -DCMAKE_CUDA_COMPILER="$CUDA_DIR/bin/nvcc" -DMKLROOT=${CONDA_PREFIX} -DCMAKE_INSTALL_PREFIX=build/target -DOpenMP_C_FLAGS= -DCMAKE_C_FLAGS="-liomp5 -lpthread -L${CONDA_PREFIX}/lib" -DCMAKE_CXX_FLAGS="-liomp5 -lpthread -L${CONDA_PREFIX}/lib" -DCMAKE_Fortran_FLAGS="-I${MKLROOT}/include -liomp5 -L${MKLROOT}/lib/ -lmkl_core -lmkl_gnu_thread -lmkl_gf_lp64" -DOpenMP_CXX_FLAGS="-qopenmp" -DOpenMP_CXX_LIB_NAMES="libiomp5" -DOpenMP_libiomp5_LIBRARY=${CONDA_PREFIX}/lib/libiomp5.so -DOpenMP_C_FLAGS="-qopenmp" -DOpenMP_C_LIB_NAMES="libiomp5" . -Bbuild ``` Build Magma: -
zhanwenchen revised this gist
Aug 7, 2023 . 1 changed file with 18 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,18 +32,34 @@ echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt sudo apt update sudo apt install intel-basekit intel-aikit # Source the Intel oneAPI . /opt/intel/oneapi/setvars.sh conda create -n ietrans conda activate ietrans conda config --env --add channels intel # As of writing, intel python 3.11 has not been released yet. conda install intelpython3_core python=3.10 mkl mkl-include export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib export MKLROOT=${CONDA_PREFIX} export BLASLDFLAGS=-Wl,--no-as-needed -L$(MKLROOT)/lib -lmkl_intel_ilp64 \ -lmkl_core -lmkl_intel_thread -ldl -lpthread -liomp5 ``` Configure Magma (see [README](https://bitbucket.org/icl/magma/src/master/README)): ```bash #export LD_LIBRARY_PATH=${HOME}/anaconda3/lib:${LD_LIBRARY_PATH} #export LD_PRELOAD=${HOME}/anaconda3/lib/libmkl_core.so:${HOME}/anaconda3/lib/libmkl_sequential.so echo -e "GPU_TARGET = sm_86\nBACKEND = cuda\nFORT = false" > make.inc make generate export CUDA_DIR=/usr/local/cuda-12.2 export LD_PRELOAD= # be careful here; they didn't accept sm_89 so I had to round it down to major version, sm_80 cmake -DGPU_TARGET=Ampere -DCMAKE_CUDA_COMPILER="$CUDA_DIR/bin/nvcc" -DCMAKE_INSTALL_PREFIX=build/target . -Bbuild ``` -
zhanwenchen revised this gist
Aug 7, 2023 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,6 +34,9 @@ sudo apt update sudo apt install intel-basekit # Source the Intel oneAPI . /opt/intel/oneapi/setvars.sh ``` Configure Magma (see [README](https://bitbucket.org/icl/magma/src/master/README)): -
zhanwenchen revised this gist
Aug 7, 2023 . 1 changed file with 7 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,19 +22,22 @@ Install a Fortran compiler: sudo apt-get install gfortran ``` Install Intel BLAS and LAPACK (https://www.intel.com/content/www/us/en/docs/oneapi/installation-guide-linux/2023-2/apt.html#GUID-186C17A8-4183-4BC3-B367-01331B1B74AF) ```bash wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null # Type sudo password echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list sudo apt update sudo apt install intel-basekit ``` Configure Magma (see [README](https://bitbucket.org/icl/magma/src/master/README)): ```bash echo -e "GPU_TARGET = sm_86\nBACKEND = cuda\nFORT = false" > make.inc make generate CUDA_DIR=/usr/local/cuda-12.2 -
zhanwenchen revised this gist
Aug 7, 2023 . 1 changed file with 13 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,4 @@ I wrote these instructions as part of ["installing PyTorch with CUDA 12.1.1"](https://gist.github.com/Birch-san/211f31f8d901dadd1025398fa1a603b8). Anyway, if you still need to compile from source… here's how: @@ -30,13 +22,24 @@ Install a Fortran compiler: sudo apt-get install gfortran ``` Install Intel BLAS and LAPACK (https://www.intel.com/content/www/us/en/docs/oneapi/installation-guide-linux/2023-0/apt.html) ```bash wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null --2023-08-07 00:02:33-- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB # Type sudo password ``` Configure Magma (see [README](https://bitbucket.org/icl/magma/src/master/README)): ```bash sudo apt install intel-basekit echo -e "GPU_TARGET = sm_86\nBACKEND = cuda\nFORT = false" > make.inc make generate CUDA_DIR=/usr/local/cuda-12.2 # be careful here; they didn't accept sm_89 so I had to round it down to major version, sm_80 cmake -DGPU_TARGET=Ampere -DCMAKE_CUDA_COMPILER="$CUDA_DIR/bin/nvcc" -DCMAKE_INSTALL_PREFIX=build/target . -Bbuild ``` Build Magma: -
zhanwenchen revised this gist
Aug 7, 2023 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,11 +32,11 @@ sudo apt-get install gfortran Configure Magma (see [README](https://bitbucket.org/icl/magma/src/master/README)): ```bash echo -e "GPU_TARGET = sm_86\nBACKEND = cuda\nFORT = false" > make.inc make generate CUDA_DIR=/usr/local/cuda-12.2 # be careful here; they didn't accept sm_89 so I had to round it down to major version, sm_80 cmake -DGPU_TARGET=sm_86 -DCMAKE_CUDA_COMPILER="$CUDA_DIR/bin/nvcc" -DCMAKE_INSTALL_PREFIX=build/target . -Bbuild ``` Build Magma: -
Birch-san created this gist
Apr 27, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ I wrote these instructions as part of ["installing PyTorch with CUDA 12.1.1"](https://gist.github.com/Birch-san/211f31f8d901dadd1025398fa1a603b8). I extracted them into this separate gist, because I realised there's a _much_ easier way to install magma for CUDA 12.1.1: https://anaconda.org/pytorch/magma-cuda121 There's a conda package! ```bash conda install -c pytorch magma-cuda121 ``` Anyway, if you still need to compile from source… here's how: ## Build Magma from source This is a dependency of PyTorch, which is sensitive to CUDA version. Clone [Magma](https://bitbucket.org/icl/magma/src/master/): ```bash git clone --depth 1 https://bitbucket.org/icl/magma.git cd magma ``` Look up your [CUDA Architecture](https://en.wikipedia.org/wiki/CUDA#GPUs_supported), e.g. 4090 has architecture 8.9. Use this to determine the two `GPU_TARGET` variables below. **Activate your conda environment, if you haven't done so already.** Install a Fortran compiler: ```bash sudo apt-get install gfortran ``` Configure Magma (see [README](https://bitbucket.org/icl/magma/src/master/README)): ```bash echo -e "GPU_TARGET = sm_89\nBACKEND = cuda\nFORT = false" > make.inc make generate CUDA_DIR=/usr/local/cuda-12.1 # be careful here; they didn't accept sm_89 so I had to round it down to major version, sm_80 cmake -DGPU_TARGET=sm_80 -DCMAKE_CUDA_COMPILER="$CUDA_DIR/bin/nvcc" -DCMAKE_INSTALL_PREFIX=build/target . -Bbuild ``` Build Magma: ```bash cmake --build build -j $(nproc) --target install ``` Install Magma: ```bash sudo cp build/target/include/* /usr/local/include/ sudo cp build/target/lib/*.so /usr/local/lib/ sudo cp build/target/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/ ```