conda-and-cuda-envs
codepasta
sh
a year ago
954 B
10
Indexable
# conda & cuda
conda create -n cuda_env python=3.8
conda activate cuda_env
Wenn Miniforge, conda-forge Channel standardmäßig als Hauptkanal konfiguriert
conda install gcc gxx cmake make
conda install -c nvidia cuda-toolkit
Oder conda-forge Channel für CUDA verwenden, oft aktueller
conda install cuda-toolkit
oder
conda activate cuda10
conda install -c nvidia cuda-toolkit=10.0
und/oder
conda activate cuda11
conda install -c nvidia cuda-toolkit=11.0
weiters
conda install numpy scipy pandas
Beispiel mit CMake
mkdir build && cd build
cmake ..
make
Beispiel mit direkter Kompilierung
nvcc -c cuda_file.cu
g++ -c cpp_file.cpp
g++ cuda_file.o cpp_file.o -o my_program -lcudart
korrekte Syntax, jedes Paket separat außerhalb Anführungszeichen angeben
vollständiger Befehl könnte so aussehen:
conda install "numpy~=1.26.4" torch=2.2.1 requests "protobuf>=4.21.0,<5.0.0"
Editor is loading...
Leave a Comment